Abstract base class for all user-authored native scripts.
More...
#include <ScriptBase.h>
|
| virtual | ~ScriptBase ()=default |
| virtual void | OnCreate () |
| | Called once after the script instance is created and fields are applied.
|
| virtual void | OnUpdate (float dt) |
| | Called every frame while the scene is running.
|
| virtual void | OnDestroy () |
| | Called once just before the script instance is destroyed.
|
|
| u64 | EntityID = 0 |
| | ECS identifier of the entity this script is attached to.
|
| Registry * | Scene = nullptr |
| | Non-owning pointer to the scene's ECS registry. Valid during play mode only.
|
Abstract base class for all user-authored native scripts.
User scripts inherit from ScriptBase inside their script DLL and override whichever lifecycle methods they need. The engine never calls these directly it goes through ScriptRuntime, which guards each call with SEH.
EntityID and Scene are injected by ScriptRuntime::OnRuntimeStart before OnCreate is called and are valid for the entire play-mode session.
◆ ~ScriptBase()
| virtual Raven::ScriptBase::~ScriptBase |
( |
| ) |
|
|
virtualdefault |
◆ OnCreate()
| virtual void Raven::ScriptBase::OnCreate |
( |
| ) |
|
|
inlinevirtual |
Called once after the script instance is created and fields are applied.
Override to perform one-time initialisation (e.g. caching component pointers, spawning child entities).
◆ OnDestroy()
| virtual void Raven::ScriptBase::OnDestroy |
( |
| ) |
|
|
inlinevirtual |
Called once just before the script instance is destroyed.
Override to release any resources acquired in OnCreate.
◆ OnUpdate()
| virtual void Raven::ScriptBase::OnUpdate |
( |
float | dt | ) |
|
|
inlinevirtual |
Called every frame while the scene is running.
- Parameters
-
| dt | Time elapsed since the previous frame (seconds). |
◆ EntityID
| u64 Raven::ScriptBase::EntityID = 0 |
ECS identifier of the entity this script is attached to.
◆ Scene
| Registry* Raven::ScriptBase::Scene = nullptr |
Non-owning pointer to the scene's ECS registry. Valid during play mode only.
The documentation for this class was generated from the following file: