| 1055 | } |
| 1056 | |
| 1057 | void Actor::EndPlay() |
| 1058 | { |
| 1059 | CHECK_DEBUG(IsDuringPlay()); |
| 1060 | |
| 1061 | // Fire event for scripting |
| 1062 | if (IsActiveInHierarchy() && GetScene()) |
| 1063 | { |
| 1064 | ASSERT(GetScene()); |
| 1065 | OnDisable(); |
| 1066 | } |
| 1067 | |
| 1068 | for (auto* script : Scripts) |
| 1069 | { |
| 1070 | if (script->_wasAwakeCalled) |
| 1071 | { |
| 1072 | script->_wasAwakeCalled = false; |
| 1073 | CHECK_EXECUTE_IN_EDITOR |
| 1074 | { |
| 1075 | script->OnDestroy(); |
| 1076 | } |
| 1077 | } |
| 1078 | } |
| 1079 | |
| 1080 | OnEndPlay(); |
| 1081 |
no test coverage detected