mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Even more DotNet stuff, help
This commit is contained in:
@@ -288,4 +288,35 @@ namespace GlitchyEngine.World
|
||||
DestroyInstanceFunction(&this);
|
||||
}
|
||||
}
|
||||
|
||||
struct DotNetScriptComponent : IDisposableComponent
|
||||
{
|
||||
public void* InstanceHandlePtr = null;
|
||||
|
||||
private String TypeName = null;
|
||||
|
||||
typealias CreateInstanceDelegate = function void*(void* typeNamePtr, int32 typeNameLength, EcsEntity entity);
|
||||
|
||||
public static CreateInstanceDelegate DelCreateInstance;
|
||||
|
||||
public void Bind(StringView dotNetAssemblyQualifiedTypeName) mut
|
||||
{
|
||||
TypeName = new String(dotNetAssemblyQualifiedTypeName);
|
||||
}
|
||||
|
||||
internal void CreateInstance(EcsEntity entity) mut
|
||||
{
|
||||
//IntPtr CreateInstance(IntPtr typeNamePtr, int typeNameLength, EcsEntity entity)
|
||||
InstanceHandlePtr = DelCreateInstance(TypeName.Ptr, (int32)TypeName.Length, entity);
|
||||
}
|
||||
|
||||
internal void UpdateInstance()
|
||||
{
|
||||
}
|
||||
|
||||
public void Dispose() mut
|
||||
{
|
||||
delete TypeName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user