1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

mono: add IsInstanceValid(), move WeakRef()

This commit is contained in:
Kelly Thomas
2018-08-11 00:41:46 +08:00
parent 6e0adf3656
commit 9341129d14
3 changed files with 18 additions and 6 deletions

View 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));
}
}
}