Merge pull request #20890 from KellyThomas/mono-is-instance-valid

mono: add IsInstanceValid(), move WeakRef()
This commit is contained in:
Ignacio Etcheverry 2018-08-14 18:12:18 +02:00 committed by GitHub
commit d7b9fcd336
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View file

@ -192,10 +192,5 @@ namespace Godot
{
return NativeCalls.godot_icall_Godot_var2str(var);
}
public static WeakRef WeakRef(Object obj)
{
return NativeCalls.godot_icall_Godot_weakref(Object.GetPtr(obj));
}
}
}

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

View file

@ -1 +1 @@
7
8