| 188 | } |
| 189 | |
| 190 | void ScriptingSystem::InitializeNewScripts() |
| 191 | { |
| 192 | auto& scriptingEngineNet = ScriptingEngineNet::Get(); |
| 193 | auto netEntities = m_Scene->m_Registry.view<NetScriptComponent>(); |
| 194 | |
| 195 | // Instance all the new entities |
| 196 | std::vector<Entity> entityJustInstanced; |
| 197 | for (auto& e : netEntities) |
| 198 | { |
| 199 | auto& netScriptComponent = netEntities.get<NetScriptComponent>(e); |
| 200 | if (!netScriptComponent.Initialized) |
| 201 | { |
| 202 | if (netScriptComponent.ScriptPath.empty()) |
| 203 | continue; |
| 204 | |
| 205 | auto entity = Entity{ e, m_Scene }; |
| 206 | |
| 207 | // Creates an instance of the entity script in C# |
| 208 | scriptingEngineNet.RegisterEntityScript(entity); |
| 209 | |
| 210 | netScriptComponent.Initialized = true; |
| 211 | entityJustInstanced.push_back(entity); |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | void ScriptingSystem::DispatchPhysicCallbacks() |
| 217 | { |
nothing calls this directly
no test coverage detected