This commit is contained in:
Isuru Samarathunga
2025-10-30 23:40:39 +05:30
parent 4e41048352
commit 7530303389
3 changed files with 27 additions and 5 deletions

View File

@ -34,7 +34,7 @@ namespace ia::iae
for(auto& t: m_components) for(auto& t: m_components)
t->Draw(); t->Draw();
for(auto& t: m_children) for(auto& t: m_children)
t->Draw(); if B_LIKELY(t->IsEnabled()) t->Draw();
} }
VOID Node2D::DebugDraw() VOID Node2D::DebugDraw()
@ -42,7 +42,7 @@ namespace ia::iae
for(auto& t: m_components) for(auto& t: m_components)
t->DebugDraw(); t->DebugDraw();
for(auto& t: m_children) for(auto& t: m_children)
t->DebugDraw(); if B_LIKELY(t->IsEnabled()) t->DebugDraw();
} }
VOID Node2D::Update() VOID Node2D::Update()
@ -50,7 +50,7 @@ namespace ia::iae
for(auto& t: m_components) for(auto& t: m_components)
t->Update(); t->Update();
for(auto& t: m_children) for(auto& t: m_children)
t->Update(); if B_LIKELY(t->IsEnabled()) t->Update();
} }
VOID Node2D::FixedUpdate() VOID Node2D::FixedUpdate()
@ -58,6 +58,6 @@ namespace ia::iae
for(auto& t: m_components) for(auto& t: m_components)
t->FixedUpdate(); t->FixedUpdate();
for(auto& t: m_children) for(auto& t: m_children)
t->FixedUpdate(); if B_LIKELY(t->IsEnabled()) t->FixedUpdate();
} }
} // namespace ia::iae } // namespace ia::iae

View File

@ -45,7 +45,18 @@ namespace ia::iae
return m_node; return m_node;
} }
BOOL &IsEnabled()
{
return m_isEnabled;
}
BOOL IsEnabled() CONST
{
return m_isEnabled;
}
protected: protected:
Node2D *CONST m_node{}; Node2D *CONST m_node{};
BOOL m_isEnabled{true};
}; };
} // namespace ia::iae } // namespace ia::iae

View File

@ -38,7 +38,18 @@ namespace ia::iae
return m_name; return m_name;
} }
BOOL &IsEnabled()
{
return m_isEnabled;
}
BOOL IsEnabled() CONST
{
return m_isEnabled;
}
protected: protected:
CONST String m_name; CONST String m_name;
BOOL m_isEnabled{true};
}; };
} // namespace ia::iae } // namespace ia::iae