This is the power up event. I have created a basic script called "ActivateLights", which is a public method to change emission and activate some GameObjects.
You can add whatever you want here, whether that's opening a door, turning on a generator or more!
publicclassActivateLights:MonoBehaviour { [Header("Array of Mesh renderer for objects we want to change the emission")] [SerializeField] privateRenderer[] thisMaterial =null;privatestring emissionName ="_EMISSION"; [SerializeField] privateGameObject[] lights =null; //This is just a sample example of a type of action you could do after the generator is filled, this simulated turning on lights
publicvoidPowerLights() {foreach (GameObject lightObjects in lights) {lightObjects.SetActive(true); }foreach (Renderer emissiveMaterial in thisMaterial) {emissiveMaterial.material.EnableKeyword(emissionName); } }publicvoidDeactivateLights() {foreach (GameObject lightObjects in lights) {lightObjects.SetActive(false); }foreach (Renderer emissiveMaterial in thisMaterial) {emissiveMaterial.material.DisableKeyword(emissionName); } } }