From 900c7333a8fb468dfb20baf46089f5010a0a9878 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 11 Sep 2023 20:20:14 -0700 Subject: [PATCH] move around code, more comment --- NewHorizons/Builder/Props/DetailBuilder.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 55f77152..245ba6c1 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -339,14 +339,6 @@ namespace NewHorizons.Builder.Props component.gameObject.layer = Layer.IgnoreSun; } } - // Else it spams a ton of NRE, happens when you try to put a non-hostile Ghostbird - else if (component is GhostIK or GhostEffects) - { - // For when somebody (pikmin) makes a Unity ghost bird - if (component.transform.parent.GetComponent() == null) - UnityEngine.Object.DestroyImmediate(component); - return; - } else if (component is DarkMatterVolume) { var probeVisuals = component.gameObject.transform.Find("ProbeVisuals"); @@ -402,8 +394,15 @@ namespace NewHorizons.Builder.Props else if (component is Renderer renderer && component.gameObject.GetComponent() == null) renderer.enabled = true; else if(component is Shape shape) shape.enabled = true; - // If it's not a moving anglerfish make sure the anim controller is regular - else if(component is AnglerfishAnimController && component.transform.parent.GetComponent() == null) //Manual parent chain so we can find inactive + // If it's not a moving ghostbird (ie Prefab_IP_GhostBird/Ghostbird_IP_ANIM) make sure it doesnt spam NREs + // Manual parent chain so we can find inactive + else if (component is GhostIK or GhostEffects && component.transform.parent.GetComponent() == null) + { + UnityEngine.Object.DestroyImmediate(component); + } + // If it's not a moving anglerfish (ie Anglerfish_Body/Beast_Anglerfish) make sure the anim controller is regular + // Manual parent chain so we can find inactive + else if(component is AnglerfishAnimController && component.transform.parent.GetComponent() == null) { component.gameObject.AddComponent(); }