Power Event

  1. Using the UnityEvent feature on each controller will allow you to add multiple event types, see the demo scene for a clear example on this.

void ActivateGenerator()
{
     rumbling = true;
     activateGenerator.Invoke();
}

void DeactivateGenerator()
{
     rumbling = false;
     deactivateGenerator.Invoke();
}

The events below run the:

  • Activate Generator script

  • Start an audio effect parented to the object (3D generator sound)

  • Turns the red light off

  • Turns the green light on

The opposite happens in the deactivate section

  • Below is the script that gets activated by the event

Last updated

Was this helpful?