Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Custom Events

Custom Events

The RTS Engine allows to customize your RTS game furthermore using custom events. To make use of those events, make sure that you have the Custom Events component in the map (you can find it in the “GameManager” object when creating a new map using the RTS Engine menu editor).

To see a list of the available events that you can use in your own scripts, open the Custom Events and go through them all!

The custom events also allow you to access components of objects that are related to the event. For example one of the events is called when a unit is created, from this event you can access the whole Unit component of the newly created unit and get/set attributes and call functions from within the Unit component.

Custom Events are also used by NPC components to monitor and control the NPC faction’s behavior.

Below is an example code of how we can use custom events. The same script is available in the asset under the name: CustomEventsExample.cs


How can we help?