Class Engine::ScriptSystem¶
ClassList > Engine > ScriptSystem
Updates all entities with a ScriptComponent by calling their Lua onUpdate(dt) function.More...
#include <ScriptSystem.hpp>
Inherits the following classes: Engine::System
Public Attributes inherited from Engine::System¶
See Engine::System
| Type | Name |
|---|---|
| std::set< Entity > | m_Entities |
Public Functions¶
| Type | Name |
|---|---|
| sol::state_view | GetLua () Shared Lua state used by gameplay scripts and later binders. |
| bool | IsApiReady () const True once the engine API and LuaBinder modules have been registered. |
| virtual void | OnSceneUnloaded (Registry & registry) override Calls onDestroy on every loaded script before the scene's entities go away. |
| virtual void | Render (Registry & registry) override World pass: drawn inside the active camera. |
| ScriptSystem () |
|
| virtual void | Update (Registry & registry, float dt) override |
| void | loadScript (Registry & registry, Entity entity) |
| void | unloadScript (Registry & registry, Entity entity) |
| ~ScriptSystem () |
Public Functions inherited from Engine::System¶
See Engine::System
| Type | Name |
|---|---|
| virtual void | OnSceneUnloaded (Registry & registry) Called right before the current scene's entities are destroyed. |
| virtual void | Render (Registry & registry) World pass: drawn inside the active camera. |
| virtual void | RenderScreen (Registry & registry) Screen pass: drawn after the world, in window pixels. |
| virtual void | Update (Registry & registry, float dt) |
| virtual | ~System () = default |
Detailed Description¶
Also handles script loading (onCreate) and unloading (onDestroy).
Public Functions Documentation¶
function GetLua¶
Shared Lua state used by gameplay scripts and later binders.
Returns:
A view of the state. Valid after the first Update outside the editor.
function IsApiReady¶
True once the engine API and LuaBinder modules have been registered.
function OnSceneUnloaded¶
Calls onDestroy on every loaded script before the scene's entities go away.
The Lua state itself is kept: globals set by scripts survive a scene switch, while each script's own table is dropped with its entity.
Implements Engine::System::OnSceneUnloaded
function Render¶
World pass: drawn inside the active camera.
Implements Engine::System::Render
function ScriptSystem¶
function Update¶
Implements Engine::System::Update
function loadScript¶
function unloadScript¶
function ~ScriptSystem¶
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Scripting/ScriptSystem.hpp