Sdk/BaseComponent: Add OnEntityDisabled and OnEntityEnabled callbacks
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user