From 68110660e9bfd781ef783219dc35951cca0eb389 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:24:23 +0100 Subject: [PATCH] fix dumb dreamworldspawnanimator return goof --- .../Remote/DreamWorldSpawnAnimator.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs b/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs index b189ecf6..9f9d52d9 100644 --- a/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs +++ b/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs @@ -16,6 +16,13 @@ public class DreamWorldSpawnAnimator : MonoBehaviour { enabled = false; + _spawnEffectMaterial = GetSpawnMaterial(); + _spawnEffectMaterial.SetFloat("_Enabled", 0f); + _spawnEffectMaterial.SetFloat("_Progression", 0f); + } + + private Material GetSpawnMaterial() + { foreach (var renderer in GetComponentsInChildren(true)) { foreach (var material in renderer.sharedMaterials) @@ -27,14 +34,12 @@ public class DreamWorldSpawnAnimator : MonoBehaviour if (material.shader.name == "DreamWorldSpawnEffect") { - _spawnEffectMaterial = material; - return; + return material; } } } - _spawnEffectMaterial.SetFloat("_Enabled", 0f); - _spawnEffectMaterial.SetFloat("_Progression", 0f); + return null; } public void StartSpawnEffect()