MCPcopy Create free account
hub / github.com/antopilo/Nuake / InitializeNewScripts

Method InitializeNewScripts

Nuake/Source/Nuake/Scene/Systems/ScriptingSystem.cpp:190–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

RegisterEntityScriptMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected