20 IDLE = 0, INIT = 1, DESTROY = -1, UNKOWN = -2
27 explicit SGameObject(std::string name, std::string hash);
33 virtual void Tick(
float elapsedTime);
35 void Exterminate()
override;
42 void SetUndestroyable(
bool enable)
override;
46 void RemoveChildren(
bool isAllLevel =
false);
56 const std::list<SGameObject*>& GetChildren()
const;
68 T* GetComponentByHash(
const std::string&
id)
const;
70 SComponent* GetSComponentByHash(
const std::string& hash)
const;
72 const std::list<SComponent*>& GetComponents()
const;
74 HSQOBJECT GetCustomComponent(
const char* className);
87 static SGameObject* FindByHash(
const std::string& hash);
90 std::string GetName()
const {
94 std::string GetID()
const;
96 std::string GetID(
const SComponent* component)
const;
98 void SetName(std::string name) {
99 m_name = std::move(name);
106 STATUS GetStatus()
const {
110 bool GetIsEnable()
const;
112 void SetIsEnable(
bool is_enable);
114 std::string GenerateMeta()
override;
117 void UpdateComponent(
float elapsedTime);
120 std::list<SGameObject*> m_children;
123 std::list<SComponent*> m_components;
126 bool isEnable =
true;
127 STATUS m_status = INIT;
128 bool m_isPrefab =
false;
129 std::string m_resourceID;
131 bool isPrefab(
bool OnlyThisObject =
false)
const;
133 void SetIsPrefab(
bool m_isPrefab);
135 std::string GetResourceID()
const;
137 void SetResourceID(
const std::string& resID,
bool setChildren =
false);