You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
mono: add IsInstanceValid(), move WeakRef()
This commit is contained in:
@@ -192,10 +192,5 @@ namespace Godot
|
|||||||
{
|
{
|
||||||
return NativeCalls.godot_icall_Godot_var2str(var);
|
return NativeCalls.godot_icall_Godot_var2str(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WeakRef WeakRef(Object obj)
|
|
||||||
{
|
|
||||||
return NativeCalls.godot_icall_Godot_weakref(Object.GetPtr(obj));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17
modules/mono/glue/cs_files/ObjectExtensions.cs
Normal file
17
modules/mono/glue/cs_files/ObjectExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Godot
|
||||||
|
{
|
||||||
|
public partial class Object
|
||||||
|
{
|
||||||
|
public static bool IsInstanceValid(Object instance)
|
||||||
|
{
|
||||||
|
return instance != null && instance.NativeInstance != IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeakRef WeakRef(Object obj)
|
||||||
|
{
|
||||||
|
return NativeCalls.godot_icall_Godot_weakref(Object.GetPtr(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
7
|
8
|
||||||
|
|||||||
Reference in New Issue
Block a user