Added ShowMouse and get global position to .net api, deferred onInit after all entities have been initialized
This commit is contained in:
@@ -52,13 +52,22 @@ namespace Nuake
|
||||
if (netScriptComponent.ScriptPath.empty())
|
||||
continue;
|
||||
|
||||
// Creates an instance of the entity script in C#
|
||||
auto entity = Entity{ e, m_Scene };
|
||||
scriptingEngineNet.RegisterEntityScript(entity);
|
||||
|
||||
// We can now call on init on it.
|
||||
auto scriptInstance = scriptingEngineNet.GetEntityScript(entity);
|
||||
scriptInstance.InvokeMethod("OnInit");
|
||||
// Creates an instance of the entity script in C#
|
||||
scriptingEngineNet.RegisterEntityScript(entity);
|
||||
}
|
||||
|
||||
for (auto& e : netEntities)
|
||||
{
|
||||
auto entity = Entity{ e, m_Scene };
|
||||
|
||||
if (entity.IsValid() && scriptingEngineNet.HasEntityScriptInstance(entity))
|
||||
{
|
||||
// We can now call on init on it.
|
||||
auto scriptInstance = scriptingEngineNet.GetEntityScript(entity);
|
||||
scriptInstance.InvokeMethod("OnInit");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user