diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 7b687fe0..6a3add28 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -157,9 +157,9 @@ namespace NewHorizons.Builder.Props // Fix vision torch if (component is VisionTorchItem) { - (component as VisionTorchItem).enabled = true; - (component as VisionTorchItem).mindProjectorTrigger.enabled = true; - (component as VisionTorchItem).mindSlideProjector._mindProjectorImageEffect = GameObject.Find("Player_Body/PlayerCamera").GetComponent(); + (component as VisionTorchItem).enabled = true; + (component as VisionTorchItem).mindProjectorTrigger.enabled = true; + (component as VisionTorchItem).mindSlideProjector._mindProjectorImageEffect = GameObject.Find("Player_Body/PlayerCamera").GetComponent(); } } else diff --git a/NewHorizons/Builder/Props/ProjectionBuilder.cs b/NewHorizons/Builder/Props/ProjectionBuilder.cs index b4bc971c..9e3e03e0 100644 --- a/NewHorizons/Builder/Props/ProjectionBuilder.cs +++ b/NewHorizons/Builder/Props/ProjectionBuilder.cs @@ -73,11 +73,11 @@ namespace NewHorizons.Builder.Props AddModules(slideInfo, ref slide); slideCollection.slides[i] = slide; - } - - // this variable just lets us track how many of the first 15 slides have been loaded. - // this way as soon as the last one is loaded (due to async loading, this may be - // slide 7, or slide 3, or whatever), we can build the slide reel texture. This allows us + } + + // this variable just lets us track how many of the first 15 slides have been loaded. + // this way as soon as the last one is loaded (due to async loading, this may be + // slide 7, or slide 3, or whatever), we can build the slide reel texture. This allows us // to avoid doing a "is every element in the array `textures` not null" check every time a texture finishes loading int displaySlidesLoaded = 0; imageLoader.imageLoadedEvent.AddListener( @@ -93,7 +93,7 @@ namespace NewHorizons.Builder.Props } if (displaySlidesLoaded >= textures.Length) - { + { // all textures required to build the reel's textures have been loaded var slidesBack = slideReelObj.transform.Find("Props_IP_SlideReel_7/Slides_Back").GetComponent(); var slidesFront = slideReelObj.transform.Find("Props_IP_SlideReel_7/Slides_Front").GetComponent(); @@ -248,12 +248,12 @@ namespace NewHorizons.Builder.Props // var mindSlideProjector = standingTorch.GetComponent(); - mindSlideProjector._mindProjectorImageEffect = GameObject.Find("Player_Body/PlayerCamera").GetComponent(); - - // setup for visually supporting async texture loading - mindSlideProjector.enabled = false; - var visionBeamEffect = SearchUtilities.FindChild(standingTorch, "VisionBeam"); - visionBeamEffect.SetActive(false); + mindSlideProjector._mindProjectorImageEffect = GameObject.Find("Player_Body/PlayerCamera").GetComponent(); + + // setup for visually supporting async texture loading + mindSlideProjector.enabled = false; + var visionBeamEffect = SearchUtilities.FindChild(standingTorch, "VisionBeam"); + visionBeamEffect.SetActive(false); // // set up slides @@ -276,10 +276,10 @@ namespace NewHorizons.Builder.Props slideCollection.slides[i] = slide; } - - // this variable just lets us track how many of the slides have been loaded. - // this way as soon as the last one is loaded (due to async loading, this may be - // slide 7, or slide 3, or whatever), we can enable the vision torch. This allows us + + // this variable just lets us track how many of the slides have been loaded. + // this way as soon as the last one is loaded (due to async loading, this may be + // slide 7, or slide 3, or whatever), we can enable the vision torch. This allows us // to avoid doing a "is every element in the array `slideCollection.slides` not null" check every time a texture finishes loading int displaySlidesLoaded = 0; imageLoader.imageLoadedEvent.AddListener( @@ -289,8 +289,8 @@ namespace NewHorizons.Builder.Props displaySlidesLoaded++; // threading moment if (displaySlidesLoaded >= slides.Length) - { - mindSlideProjector.enabled = true; + { + mindSlideProjector.enabled = true; visionBeamEffect.SetActive(true); } } @@ -305,7 +305,7 @@ namespace NewHorizons.Builder.Props // make sure that these slides play when the player wanders into the beam // _slideCollectionItem is actually a reference to a SlideCollectionContainer. Not a slide reel item mindSlideProjector._mindSlideCollection = mindSlideCollection; - mindSlideProjector._slideCollectionItem = slideCollectionContainer; + mindSlideProjector._slideCollectionItem = slideCollectionContainer; mindSlideProjector.SetMindSlideCollection(mindSlideCollection); @@ -364,9 +364,9 @@ namespace NewHorizons.Builder.Props } } - public class VisionTorchTarget : MonoBehaviour + public class VisionTorchTarget : MonoBehaviour { - public MindSlideCollection slideCollection; - public SlideCollectionContainer slideCollectionContainer; + public MindSlideCollection slideCollection; + public SlideCollectionContainer slideCollectionContainer; } } diff --git a/NewHorizons/Utility/SearchUtilities.cs b/NewHorizons/Utility/SearchUtilities.cs index f1180e02..6697ebdc 100644 --- a/NewHorizons/Utility/SearchUtilities.cs +++ b/NewHorizons/Utility/SearchUtilities.cs @@ -119,14 +119,14 @@ namespace NewHorizons.Utility } */ - public static GameObject FindChild(GameObject g, string childName) - { - foreach(Transform child in g.transform) - { - if (child.gameObject.name == childName) return child.gameObject; - } - - return null; + public static GameObject FindChild(GameObject g, string childName) + { + foreach(Transform child in g.transform) + { + if (child.gameObject.name == childName) return child.gameObject; + } + + return null; } public static GameObject Find(string path)