Interface ILunyEngineObserver
- Namespace
- Luny
- Assembly
- Luny.dll
Lifecycle observer interface. To be implemented by observers of LunyEngine which wish to receive the engine-agnostic lifecycle callbacks.
public interface ILunyEngineObserver
Properties
Enabled
bool Enabled { get; }
Property Value
- bool
Methods
OnEngineFrameBegins()
Runs once per frame, before any frame update / heartbeat method.
void OnEngineFrameBegins()
OnEngineFrameEnds()
Runs once per frame, after all frame update methods ran (eg "end of frame").
void OnEngineFrameEnds()
OnEngineFrameLateUpdate()
Runs once per frame, after all FrameUpdate ran.
void OnEngineFrameLateUpdate()
OnEngineFrameUpdate()
Runs once per frame. It runs right after the Heartbeat (if any).
void OnEngineFrameUpdate()
OnEngineHeartbeat()
Runs on the engine's fixed stepping frequency. Most suitable for deterministic game logic and to modify the Physics simulation.
void OnEngineHeartbeat()
Remarks
Engine internal physics simulation occurs right after Heartbeat, before FrameUpdate.
Caution: Heartbeat frequency depends on engine time-stepping settings, and is not guaranteed to be in sync with FrameRate. The behaviour depends on each frame's delta time (frame rate) and the engine's fixed step (or physics) time setting. - Heartbeat may be called less often than FrameUpdate - Heartbeat may be called several times in a single frame (multiple times before FrameUpdate)
OnEngineShutdown()
Runs when the application exits (once-only). Runs after frame processing has completed.
void OnEngineShutdown()
OnEngineStartup()
Runs when the application launches (once-only). Processing of the first frame has not begun.
void OnEngineStartup()
OnObjectRegistered(ILunyObject)
Called when a LunyObject registered with LunyEngine either via instantiation or handing ownership of an existing engine object to LunyEngine. Runs before the object's OnCreated callback.
void OnObjectRegistered(ILunyObject lunyObject)
Parameters
lunyObjectILunyObject
OnObjectUnregistered(ILunyObject)
Called when a LunyObject has unregistered from LunyEngine either by destroying it or when transferring ownership back
to the native engine. Runs after object's OnDestroy callback. The object's IsValid is false but its NativeObject reference
can still be accessed.
void OnObjectUnregistered(ILunyObject lunyObject)
Parameters
lunyObjectILunyObject
OnSceneLoaded(ILunyScene)
Runs when a scene was loaded, before frame processing begins. Also fires in the first scene the engine launches with.
void OnSceneLoaded(ILunyScene loadedScene)
Parameters
loadedSceneILunyScene
OnSceneUnloaded(ILunyScene)
Runs when a scene was unloaded. After all previous scene's objects have been invalidated (destroyed).
void OnSceneUnloaded(ILunyScene unloadedScene)
Parameters
unloadedSceneILunyScene