diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-02 15:15:26 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-02 15:15:26 -0400 |
commit | 46393662672f2510a40eb6cd5291f99a7ae14e3c (patch) | |
tree | 8b11793b474ebc6e7359289bd9e9704d58a7f58a /src/components/Script.hpp | |
parent | c1161dc0d8939814abf7da48d03b887c0aead0ff (diff) | |
parent | 062a7e2baad74f49f2548793a25f0cf5e4ae6f86 (diff) |
Merge branch 'master' of https://github.com/tcsullivan/gamedev2 into save-load
Diffstat (limited to 'src/components/Script.hpp')
-rw-r--r-- | src/components/Script.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/components/Script.hpp b/src/components/Script.hpp index 66addc8..b3c89f3 100644 --- a/src/components/Script.hpp +++ b/src/components/Script.hpp @@ -42,11 +42,24 @@ public: return *this; } - void exec(void) { + void exec(void) + { if (caller["Idle"] == sol::type::function) caller["Idle"](caller); // Call idle function and pass itself // in or to fulfill the 'self' param } + + void updatePhysics(void) + { + if (caller["PhysicsIdle"] == sol::type::function) + caller["PhysicsIdle"](caller); + } + + void updateRender(void) + { + if (caller["RenderIdle"] == sol::type::function) + caller["RenderIdle"](caller); + } }; #endif // COMPONENT_SCRIPT_HPP_ |