Sdk/BaseComponent: Add OnEntityDisabled and OnEntityEnabled callbacks

This commit is contained in:
Lynix
2017-12-10 14:06:43 +01:00
parent 33b3b2feaf
commit 498bd77d8a
7 changed files with 59 additions and 20 deletions

View File

@@ -50,6 +50,8 @@ namespace Ndk
virtual void OnComponentDetached(BaseComponent& component);
virtual void OnDetached();
virtual void OnEntityDestruction();
virtual void OnEntityDisabled();
virtual void OnEntityEnabled();
void SetEntity(Entity* entity);

View File

@@ -42,7 +42,7 @@ namespace Ndk
const EntityHandle& Clone() const;
inline void Disable();
inline void Enable(bool enable = true);
void Enable(bool enable = true);
inline BaseComponent& GetComponent(ComponentIndex index);
template<typename ComponentType> ComponentType& GetComponent();

View File

@@ -38,20 +38,6 @@ namespace Ndk
Enable(false);
}
/*!
* \brief Enables the entity
*
* \param enable Should the entity be enabled
*/
inline void Entity::Enable(bool enable)
{
if (m_enabled != enable)
{
m_enabled = enable;
Invalidate();
}
}
/*!
* \brief Gets a component in the entity by index
* \return A reference to the component