diff options
Diffstat (limited to 'Source/Asura.Engine/Component.h')
-rw-r--r-- | Source/Asura.Engine/Component.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/Asura.Engine/Component.h b/Source/Asura.Engine/Component.h new file mode 100644 index 0000000..807bbba --- /dev/null +++ b/Source/Asura.Engine/Component.h @@ -0,0 +1,43 @@ +#ifndef __AE_COMPONENT_H__ +#define __AE_COMPONENT_H__ + +#include "GameObject.h" + +namespace AsuraEngine +{ + + class GameObject; + + /// + /// ComponentͨprefabGameObjectϡ + /// + class Component : public Object + { + public: + + virtual void OnEnable(); + virtual void OnEvent(); + virtual void OnUpdate(uint32 milliseconds); + virtual void OnRender(); + virtual void OnDisable(); + + protected: + + enum class EnableCallback + { + OnEnable = 1, + OnEvent = 1 << 1, + OnUpdate = 1 << 2, + OnRender = 1 << 3, + OnDisable = 1 << 4, + }; + + EnableCallback mEnabledCallbacks; + + GameObject* mGameObject; + + }; + +} + +#endif
\ No newline at end of file |