diff options
author | chai <chaifix@163.com> | 2019-01-19 01:44:05 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-01-19 01:44:05 +0800 |
commit | 91e589d1678a8187c307e09b98b67ec4133092ff (patch) | |
tree | ee2761f047568ca7164b27399c0b2fb2f21c26b0 /Source/Asura.Engine/GameObject.h | |
parent | 91346d709abb37a063d0c29ddeb2d1a849d3afc2 (diff) |
*游戏框架改用脚本实现
Diffstat (limited to 'Source/Asura.Engine/GameObject.h')
-rw-r--r-- | Source/Asura.Engine/GameObject.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Source/Asura.Engine/GameObject.h b/Source/Asura.Engine/GameObject.h new file mode 100644 index 0000000..85dc87f --- /dev/null +++ b/Source/Asura.Engine/GameObject.h @@ -0,0 +1,56 @@ +#ifndef __AE_GAMEOBJECT_H__ +#define __AE_GAMEOBJECT_H__ + +#include "./Containers/Vector.hpp" +#include "./Math/Vector2.h" + +#include "Object.h" +#include "Component.h" +#include "Transform.h" +#include "Manager.hpp" + +namespace AsuraEngine +{ + + /// + /// Ϸʵ壬 + /// + class GameObject final : public Object + { + public: + + // Ļص + + void OnEnable(); + void OnEvent(); + void OnUpdate(uint32 milliseconds); + void OnRender(); + void OnDisable(); + + // transformͨкGameObjectλáźת + + const Transform& GetTransform(); + const Math::Vector2& GetPosition(); + const Math::Vector2& GetScale(); + const Math::Vector2& GetRotation(); + void SetTransform(const Transform& transform); + void SetPosition(const Math::Vector2& position); + void SetScale(const Math::Vector2& scale); + void SetRotation(const Math::Vector2& rotation); + + template<typename T> + inline T GetComponent() + { + return NULL; + } + + private: + + Transform mTransform; + Containers::Vector<Component*> mComponents; + + }; + +} + +#endif
\ No newline at end of file |