# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://speedtutoruk.gitbook.io/lever-system/support/power-up-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
