implemented functions from NativeFunctions.cs
This commit is contained in:
@@ -39,7 +39,7 @@ public class GameObject
|
||||
|
||||
static public GameObject Create()
|
||||
{
|
||||
NativeMethods.createGameObject(out ulong id, out uint index);
|
||||
NativeFunctions.createGameObject(out ulong id, out uint index);
|
||||
var o = new GameObject(id, index);
|
||||
return o;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class GameObject
|
||||
if(_isDestroyed)
|
||||
return;
|
||||
|
||||
_isDestroyed = NativeMethods.destroyGameObject(_index);
|
||||
_isDestroyed = NativeFunctions.freeGameObject(_index);
|
||||
if(!_isDestroyed)
|
||||
throw new Exception($"Can't destroy GameObject({_id})");
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ougge;
|
||||
|
||||
internal static class NativeMethods
|
||||
internal static class NativeFunctions
|
||||
{
|
||||
[DllImport("__Internal")]
|
||||
internal extern static bool destroyGameObject(uint index);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
internal extern static void createGameObject(out ulong id, out uint index);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
internal extern static bool freeGameObject(uint index);
|
||||
}
|
||||
Reference in New Issue
Block a user