Merge branch 'Fix-Actor-OnDestroy' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-Fix-Actor-OnDestroy
This commit is contained in:
@@ -883,6 +883,14 @@ void Actor::EndPlay()
|
|||||||
OnDisable();
|
OnDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto* script : Scripts)
|
||||||
|
{
|
||||||
|
CHECK_EXECUTE_IN_EDITOR
|
||||||
|
{
|
||||||
|
script->OnDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OnEndPlay();
|
OnEndPlay();
|
||||||
|
|
||||||
// Clear flag
|
// Clear flag
|
||||||
@@ -895,15 +903,6 @@ void Actor::EndPlay()
|
|||||||
Children[i]->EndPlay();
|
Children[i]->EndPlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fire event for scripting
|
|
||||||
for (auto* script : Scripts)
|
|
||||||
{
|
|
||||||
CHECK_EXECUTE_IN_EDITOR
|
|
||||||
{
|
|
||||||
script->OnDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inform attached scripts
|
// Inform attached scripts
|
||||||
for (int32 i = 0; i < Scripts.Count(); i++)
|
for (int32 i = 0; i < Scripts.Count(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user