Remove native script component

This commit is contained in:
Simon Lübeß
2023-12-01 23:51:53 +01:00
parent df6b522741
commit dc551fb85c
2 changed files with 0 additions and 41 deletions
@@ -308,34 +308,6 @@ namespace GlitchyEngine.World
}
}
struct NativeScriptComponent : IDisposableComponent
{
public ScriptableEntity Instance = null;
public function void (mut NativeScriptComponent this) Func;
public function ScriptableEntity () InstantiateFunction;
public function void (NativeScriptComponent* self) DestroyInstanceFunction;
public void Bind<T>() mut where T : ScriptableEntity
{
InstantiateFunction = () =>
{
return new T();
};
DestroyInstanceFunction = (self) =>
{
delete self.Instance;
};
}
public void Dispose() mut
{
DestroyInstanceFunction(&this);
}
}
struct SceneLight
{
public enum LightType
-13
View File
@@ -622,19 +622,6 @@ namespace GlitchyEngine.World
{
Debug.Profiler.ProfileScope!("Update scripts");
// Run scripts
for (var (entity, script) in _ecsWorld.Enumerate<NativeScriptComponent>())
{
if (script.Instance == null)
{
script.Instance = script.InstantiateFunction();
script.Instance._entity = Entity(entity, this);
script.Instance.[Friend]OnCreate();
}
script.Instance.[Friend]OnUpdate(gameTime);
}
// Run scripts
for (let (entity, script) in _ecsWorld.Enumerate<ScriptComponent>())
{