Life Cycle Events

Chilli Source follows strict rules for the life cycle events that each module receives. Application, States, systems and Components all receive a series of life cycle events depending on the state of the app. The following describes the lifecycle events that each module can receive.

Application

State

System

Component

All lifecycle events are only received while a module is active (for example a state will only receive events while at the top of the state stack). Events are propagated in the following order: App Systems, State Systems, Components, States then Application. States and Application receive the events after systems and Components so they can act on the result of the events. In addition, destructive events (i.e. OnDestroy, OnBackgrounded, etc) are processed in reverse order. This ensures that something available on construction will always also be available on destruction.