fix dumb dreamworldspawnanimator return goof

This commit is contained in:
Mister_Nebula 2022-03-27 22:24:23 +01:00
parent 4c6e8dbaae
commit 68110660e9

View File

@ -16,6 +16,13 @@ public class DreamWorldSpawnAnimator : MonoBehaviour
{ {
enabled = false; enabled = false;
_spawnEffectMaterial = GetSpawnMaterial();
_spawnEffectMaterial.SetFloat("_Enabled", 0f);
_spawnEffectMaterial.SetFloat("_Progression", 0f);
}
private Material GetSpawnMaterial()
{
foreach (var renderer in GetComponentsInChildren<Renderer>(true)) foreach (var renderer in GetComponentsInChildren<Renderer>(true))
{ {
foreach (var material in renderer.sharedMaterials) foreach (var material in renderer.sharedMaterials)
@ -27,14 +34,12 @@ public class DreamWorldSpawnAnimator : MonoBehaviour
if (material.shader.name == "DreamWorldSpawnEffect") if (material.shader.name == "DreamWorldSpawnEffect")
{ {
_spawnEffectMaterial = material; return material;
return;
} }
} }
} }
_spawnEffectMaterial.SetFloat("_Enabled", 0f); return null;
_spawnEffectMaterial.SetFloat("_Progression", 0f);
} }
public void StartSpawnEffect() public void StartSpawnEffect()