Sdk/BaseComponent: Add OnEntityDestruction callback

Also fixes physics component callbacks (OnContactEnd by example) being
fired while entity is destroyed
This commit is contained in:
Lynix
2017-03-03 17:52:07 +01:00
parent 04f7b40150
commit 605e5c2fd0
7 changed files with 29 additions and 0 deletions

View File

@@ -54,6 +54,15 @@ namespace Ndk
{
}
/*!
* \brief Operation to perform when the entity is destroyed and we're still attached to it
*
* \remark This is always called before the entity proper destruction, and thus its components.
*/
void BaseComponent::OnEntityDestruction()
{
}
std::vector<BaseComponent::ComponentEntry> BaseComponent::s_entries;
std::unordered_map<ComponentId, ComponentIndex> BaseComponent::s_idToIndex;
}