| 855 | } |
| 856 | |
| 857 | void Level::callActorEvent(ActorEventType eventType, Actor* a, Actor* b) |
| 858 | { |
| 859 | PROFILE_CPU(); |
| 860 | |
| 861 | ASSERT(a); |
| 862 | |
| 863 | // Call event |
| 864 | const auto scriptsDomain = Scripting::GetScriptsDomain(); |
| 865 | if (scriptsDomain != nullptr) |
| 866 | scriptsDomain->Dispatch(); |
| 867 | switch (eventType) |
| 868 | { |
| 869 | case ActorEventType::OnActorSpawned: |
| 870 | ActorSpawned(a); |
| 871 | break; |
| 872 | case ActorEventType::OnActorDeleted: |
| 873 | ActorDeleted(a); |
| 874 | break; |
| 875 | case ActorEventType::OnActorParentChanged: |
| 876 | ActorParentChanged(a, b); |
| 877 | break; |
| 878 | case ActorEventType::OnActorOrderInParentChanged: |
| 879 | ActorOrderInParentChanged(a); |
| 880 | break; |
| 881 | case ActorEventType::OnActorNameChanged: |
| 882 | ActorNameChanged(a); |
| 883 | break; |
| 884 | case ActorEventType::OnActorActiveChanged: |
| 885 | ActorActiveChanged(a); |
| 886 | break; |
| 887 | #if USE_EDITOR |
| 888 | case ActorEventType::OnActorDestroyChildren: |
| 889 | ActorDestroyChildren(a); |
| 890 | break; |
| 891 | #endif |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | void LevelImpl::flushActions() |
| 896 | { |