Sdk/Entity: Add enable/disable mechanism
Former-commit-id: 09884bdacf2b573bef516936d2580942cc5d4f66
This commit is contained in:
@@ -19,6 +19,15 @@ namespace Ndk
|
||||
return static_cast<ComponentType&>(AddComponent(std::move(ptr)));
|
||||
}
|
||||
|
||||
inline void Entity::Enable(bool enable)
|
||||
{
|
||||
if (m_enabled != enable)
|
||||
{
|
||||
m_enabled = enable;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
inline BaseComponent& Entity::GetComponent(ComponentIndex index)
|
||||
{
|
||||
///DOC: Le component doit être présent
|
||||
@@ -74,6 +83,11 @@ namespace Ndk
|
||||
return HasComponent(index);
|
||||
}
|
||||
|
||||
inline bool Entity::IsEnabled() const
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
inline bool Entity::IsValid() const
|
||||
{
|
||||
return m_valid;
|
||||
|
||||
Reference in New Issue
Block a user