> For the complete documentation index, see [llms.txt](https://speedtutoruk.gitbook.io/lever-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://speedtutoruk.gitbook.io/lever-system/support/power-up-event.md).

# Power Up Event

{% hint style="info" %}

1. 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.&#x20;
2. You can add whatever you want here, whether that's opening a door, turning on a generator or more
   {% endhint %}

![](https://3938358402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjZd3MS9LFbeyIQGU6AmI%2Fuploads%2FZU6mL0FtLsEXNq5njYj1%2FPowerUpEvent.JPG?alt=media\&token=8ad7ec95-7161-490d-be46-0af6c0e9ebc5)

```csharp
public class ActivateLights : MonoBehaviour
    {
        [Header("Array of Mesh renderer for objects we want to change the emission")]
        [SerializeField] private Renderer[] thisMaterial = null;
        private string emissionName = "_EMISSION";

        [SerializeField] private GameObject[] 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
        public void PowerLights()
        {
            foreach (GameObject lightObjects in lights)
            {
                lightObjects.SetActive(true);
            }

            foreach (Renderer emissiveMaterial in thisMaterial)
            {
                emissiveMaterial.material.EnableKeyword(emissionName);
            }
        }

        public void DeactivateLights()
        {
            foreach (GameObject lightObjects in lights)
            {
                lightObjects.SetActive(false);
            }

            foreach (Renderer emissiveMaterial in thisMaterial)
            {
                emissiveMaterial.material.DisableKeyword(emissionName);
            }
        }
    }
```

![](https://3938358402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjZd3MS9LFbeyIQGU6AmI%2Fuploads%2FBmLH1246LfsHjR3cRjdm%2FActivateLights.JPG?alt=media\&token=5166104c-908b-482f-b480-b56548c6cc7a)
