Astra Child

Mody Event

Estimated reading: 1 minute 0 views

ModyEvent is a specialized event that can trigger a UnityEvent and a set of ModyActionRunners. It is the core of the Mody system, designed to trigger one or more ModyActionRunners.

ModyEventBase is the base class for all ModyEvents. It provides a list of ModyActionRunners that trigger set actions on referenced modules. ModyEvent, on the other hand, inherits from ModyEventBase and adds a UnityEvent that gets invoked when the event is executed. Note that if a ModyEvent is not enabled, the UnityEvent will not get invoked.

ModyEvent provides several methods to check for the presence of runners or events. For example, thehasRunnersproperty returns true if there are runners attached to the event, and thehasEventsproperty returns true if the event has persistent event listeners set in the Inspector.

To execute a ModyEvent, simply call itsExecute()method. This will trigger all attached runners and invoke the UnityEvent, if present.

Note that ModyEvent is fully customizable, and you can create your own events by inheriting from ModyEventBase and adding your own functionality. You can also create your own ModyActionRunners to extend the system’s capabilities as needed.

Share this Doc
CONTENTS
Scroll to Top