public static void Build() { GameObject eye = UnityEngine.Object.Instantiate(((GameObject)BraveResources.Load("Global Prefabs/CreepyEye_Room", ".prefab")).GetComponentInChildren <CreepyEyeController>().gameObject); eye.SetActive(false); FakePrefab.MarkAsFakePrefab(eye); UnityEngine.Object.DontDestroyOnLoad(eye); CreepyEyeController controller = eye.GetComponent <CreepyEyeController>(); GreenChamberEyeController customController = eye.gameObject.AddComponent <GreenChamberEyeController>(); customController.MaxPupilRadius = controller.MaxPupilRadius; customController.layers = controller.layers; customController.poopil = controller.poopil; customController.baseSprite = controller.baseSprite; customController.isHallucination = false; Destroy(controller); GreenChamberEyeController.eyePrefab = eye; GameObject eye2 = UnityEngine.Object.Instantiate(((GameObject)BraveResources.Load("Global Prefabs/CreepyEye_Room", ".prefab")).GetComponentInChildren <CreepyEyeController>().gameObject); eye2.SetActive(false); FakePrefab.MarkAsFakePrefab(eye2); UnityEngine.Object.DontDestroyOnLoad(eye2); CreepyEyeController controller2 = eye2.GetComponent <CreepyEyeController>(); GreenChamberEyeController customController2 = eye2.gameObject.AddComponent <GreenChamberEyeController>(); customController2.MaxPupilRadius = controller2.MaxPupilRadius; customController2.layers = controller2.layers; customController2.poopil = controller2.poopil; customController2.baseSprite = controller2.baseSprite; customController2.isHallucination = true; Destroy(controller2); GreenChamberEyeController.hallucinationEyePrefab = eye2; }
public static void Build() { GameObject eye = UnityEngine.Object.Instantiate(((GameObject)BraveResources.Load("Global Prefabs/CreepyEye_Room", ".prefab")).GetComponentInChildren <CreepyEyeController>().gameObject); eye.SetActive(false); FakePrefab.MarkAsFakePrefab(eye); UnityEngine.Object.DontDestroyOnLoad(eye); CreepyEyeController controller = eye.GetComponent <CreepyEyeController>(); CustomCreepyEyeController customController = eye.gameObject.AddComponent <CustomCreepyEyeController>(); customController.MaxPupilRadius = controller.MaxPupilRadius; customController.layers = controller.layers; customController.poopil = controller.poopil; customController.baseSprite = controller.baseSprite; if (eye.GetComponent <SpeculativeRigidbody>() != null) { eye.GetComponent <SpeculativeRigidbody>().CollideWithOthers = false; eye.GetComponent <SpeculativeRigidbody>().CollideWithTileMap = false; } Destroy(controller); CustomCreepyEyeController.eyePrefab = eye; }