Unity Events Explanation

Unity API on Unity Events
Unity Doc on Unity Events

Unity events are one of the most versatile features of Unity game engine. In simplified terms they allow you to link a game object and use any of its components public functions; basically they give developers access to actions without extra scripting.
Take a look at the Unity Documentation link above to read a technical description.

We have created a dozen of generic unity events that can be used for wide variety of things. The versatility of unity events is hard to overstate: you could create full games with mainly unity events. Is that smart? No. But you could do it.

Here's what a basic trigger unity event looks like(with additional delay-option that is found from all our unity event-components, more on that later):

Unity Event Example 1

Where you see None(Object) you can link any game object from the scene hierarchy, or a scriptable object (from the project's resources folder for example). From the dropdown menu you can see what public functions and actions are available for that object's components. Below we have linked player controller-object to the unity event and can see a wide variety of components it has on it. The highlighted GameObject->SetActive(bool) will control whether the Game Object is enabled or disabled through a boolean.

Unity Event Example 2 -> Unity Event Example 2

So in short, you can use any script's public functions through unity events without extra scripting from a programmer.
Your next question might be when will the unity event happen? When will the player controller be disabled(because the 'SetActive' boolean is off) in the above image?

The answer is that it depends on the used unity event.
On right you can see a full list of Unity Events we provide in our SDK. Note that through simple programming you can create custom ones. Unity Event Example 2 If you have a need for a new generic unity event let us know in Discord.

The names tell a lot about the different unity events, but before we go through the different invoking methods for the unity events, let's take a look at our unity events base class.

Unity Event Example 2

  UnityEventsBase: Base class that all of our Unity Events inherit. This includes the extra features that are not present in standard unity events, like delay, chance and other options. You can see these on the left.

From the top to bottom:

 - Is Enabled: Whether the event can be invoked or not. If this is off, nothing will happen when you try to invoke.

 - Re Enable Wait: Will this be a one time event or re-enabled? -1 means it will not be re-enabled, 0 means it will be re-enabled immediately, over 0 and the event will be re-enabled after that delay in seconds.

 - Require Tag: If this is an event that is triggered by another game object(like trigger- or collider event), you can use unity tags to limit the invoking objects.

 - Apply Chance: Whether relative chance is applied between the unity event list entries. In the example you can see "Chance" float in the list entries. This is relative chance, so in the example chances being 1 & 1 & 2, means that there is a 25% chance for the first two entries and 50% chance for the last entry to invoke. Note that Delay changes the way it works with chance applied: rather than delays being added per consecutive events in the list, there is only one delay from the entry that gets invoked by the chance; this change is reflected in the "Total delay"-text.

 - Indexed Entity Parameters: This is more "niche" feature used with special unity events that take extra parameter arguments, like string, float, etc. With this enabled you can send these extra parameters to different list entries.

 - Loop This is for looping events. You invoke the event once and it will invoke automatically again as many times as the loop is set with set loop delay.

 - Coroutine Layer This is a randomised identifier for this particular unity event. You can cancel an invoke with a particular identifier. The use for this is that you can set the same identifier for multiple events and cancel them all at once; for example you could have multiple enemy spawners set to loop and cancel them all when certain conditions are met.

 - Coroutine Segment Which update method is used for this particluar event. In most cases the default "Update" is fine. The main reason to change this is to fix problems that stem from problematic script execution order.

The invocation triggers-options change based on the used component variant. That covers all of the base unity event options that can be found on all of our unity events. On next page we'll go through the different unity event variants we offer.