Dispatching Unity's Lifecycle events
VContainer has own PlayerLoop sub systems.
If you register a class that implements the marker interface, it will be scheduled in Unity's PlayerLoop cycle.
Since it uses PlayerLoopSystem, it works even if you register at any time (e.g: IStartable
etc)
The following interfaces and timings are available.
VContaienr entry point | Timing |
---|---|
IInitializable.Initialize() | Early PlayerLoop.Initialization |
IPostInitializable.PostInitialize() | Late PlayerLoop.Initialization |
IStartable.Start() | Nearly MonoBehaviour.Start() |
IPostStartable.PostStart() | After MonoBehaviour.Start() |
IFixedTickable.FixedTick() | Nearly MonoBehaviour.FixedUpdate() |
IPostFixedTickable.PostFixedTick() | After MonoBehaviour.FixedUpdate() |
ITickable.Tick() | Nearly MonoBehaviour.Update() |
IPostTickable.PostTick() | After MonoBehaviour.Update() |
ILateTickable.LateTick() | Nearly MonoBehaviour.LateUpdate() |
IPostLateTickable.LateTick() | After MonoBehaviour.LateUpdate() |
And
IDisposable
: With container disposes. (ForLifetime.Singleton
/Lifetime.Scoped
)