| 165 | } |
| 166 | |
| 167 | void ScriptingSystem::Exit() |
| 168 | { |
| 169 | auto& scriptingEngineNet = ScriptingEngineNet::Get(); |
| 170 | auto netEntities = m_Scene->m_Registry.view<NetScriptComponent>(); |
| 171 | for (auto& e : netEntities) |
| 172 | { |
| 173 | NetScriptComponent& netScriptComponent = netEntities.get<NetScriptComponent>(e); |
| 174 | |
| 175 | if (netScriptComponent.ScriptPath.empty()) |
| 176 | continue; |
| 177 | |
| 178 | auto entity = Entity{ e, m_Scene }; |
| 179 | if (entity.IsValid() && scriptingEngineNet.HasEntityScriptInstance(entity)) |
| 180 | { |
| 181 | Logger::Log(entity.GetComponent<NameComponent>().Name); |
| 182 | auto scriptInstance = scriptingEngineNet.GetEntityScript(entity); |
| 183 | scriptInstance->InvokeMethod("OnDestroy"); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | ScriptingEngineNet::Get().Uninitialize(); |
| 188 | } |
| 189 | |
| 190 | void ScriptingSystem::InitializeNewScripts() |
| 191 | { |
nothing calls this directly
no test coverage detected