|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <framework/components/script/scriptComponent.h>
Public Member Functions | |
| template<typename T> | |
| T * | create () |
| Script * | create (const std::string &name, const ScriptCreateOptions &options={}) |
| int | executionOrder () const |
| void | fixedUpdateScripts (float fixedDt) |
| void | initializeComponentData () override |
| void | postUpdateScripts (float dt) |
| ScriptComponent (IComponentSystem *system, Entity *entity) | |
| void | setEnabled (bool value) override |
| void | setExecutionOrder (const int value) |
| void | updateScripts (float dt) |
| Public Member Functions inherited from visutwin::canvas::Component | |
| virtual void | cloneFrom (const Component *source) |
| Component (IComponentSystem *system, Entity *entity) | |
| virtual bool | enabled () const |
| Entity * | entity () const |
| virtual void | onDisable () |
| virtual void | onEnable () |
| virtual void | onPostStateChange () |
| IComponentSystem * | system () const |
| virtual | ~Component ()=default |
| Public Member Functions inherited from visutwin::canvas::EventHandler | |
| template<typename... Args> | |
| EventHandler * | fire (const std::string &name, Args &&... args) |
| bool | hasEvent (const std::string &name) const |
| void | initEventHandler () |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandler * | off (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandler * | off (const std::string &name="", const HandleEventCallback &callback=HandleEventCallback(), void *scope=nullptr) |
| EventHandler * | offByHandle (EventHandle *handle) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | on (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | on (const std::string &name, HandleEventCallback callback, void *scope=nullptr) |
| template<typename Callback> requires (!std::is_same_v<std::decay_t<Callback>, HandleEventCallback>) | |
| EventHandle * | once (const std::string &name, Callback &&callback, void *scope=nullptr) |
| EventHandle * | once (const std::string &name, HandleEventCallback callback, void *scope=nullptr) |
| virtual | ~EventHandler ()=default |
Additional Inherited Members | |
| Protected Member Functions inherited from visutwin::canvas::Component | |
| virtual void | onSetEnabled (bool oldValue, bool newValue) |
| Protected Member Functions inherited from visutwin::canvas::EventHandler | |
| EventHandle * | addCallback (const std::string &name, HandleEventCallback callback, void *scope=nullptr, bool once=false) |
| Protected Attributes inherited from visutwin::canvas::Component | |
| bool | _enabled = true |
| Entity * | _entity |
Definition at line 28 of file scriptComponent.h.
|
inline |
Definition at line 31 of file scriptComponent.h.
References visutwin::canvas::Component::Component(), visutwin::canvas::Component::entity(), and visutwin::canvas::Component::system().
|
inline |
| Script * visutwin::canvas::ScriptComponent::create | ( | const std::string & | name, |
| const ScriptCreateOptions & | options = {} ) |
Definition at line 12 of file scriptComponent.cpp.
References visutwin::canvas::Component::_entity, visutwin::canvas::ScriptCreateOptions::enabled, and visutwin::canvas::ScriptCreateOptions::preloading.
|
inline |
Definition at line 48 of file scriptComponent.h.
| void visutwin::canvas::ScriptComponent::fixedUpdateScripts | ( | float | fixedDt | ) |
Definition at line 88 of file scriptComponent.cpp.
References visutwin::canvas::Component::_enabled, visutwin::canvas::Script::enabled(), and visutwin::canvas::Script::fixedUpdate().
|
inlineoverridevirtual |
Implements visutwin::canvas::Component.
Definition at line 41 of file scriptComponent.h.
| void visutwin::canvas::ScriptComponent::postUpdateScripts | ( | float | dt | ) |
Definition at line 118 of file scriptComponent.cpp.
References visutwin::canvas::Component::_enabled, visutwin::canvas::Script::enabled(), and visutwin::canvas::Script::postUpdate().
|
overridevirtual |
Reimplemented from visutwin::canvas::Component.
Definition at line 51 of file scriptComponent.cpp.
References visutwin::canvas::Component::_enabled, and visutwin::canvas::Component::setEnabled().
|
inline |
Definition at line 49 of file scriptComponent.h.
| void visutwin::canvas::ScriptComponent::updateScripts | ( | float | dt | ) |
Definition at line 103 of file scriptComponent.cpp.
References visutwin::canvas::Component::_enabled, visutwin::canvas::Script::enabled(), and visutwin::canvas::Script::update().