Files
Inter-Face-Off/Assets/Scripts/NullCheckers.cs
2026-01-13 10:23:50 +00:00

33 lines
1.0 KiB
C#

using System.Runtime.CompilerServices;
using JetBrains.Annotations;
using Unity.VisualScripting;
namespace InterfaceOff
{
public class DebugUtils
{
[MethodImpl(MethodImplOptions.AggressiveInlining), AssertionMethod, ContractAnnotation("null => true")]
public static bool IsNull(UnityEngine.Object obj)
{
return obj.IsUnityNull();
}
[MethodImpl(MethodImplOptions.AggressiveInlining), AssertionMethod, ContractAnnotation("null => true")]
public static bool IsNull(object obj)
{
return obj == null;
}
[MethodImpl(MethodImplOptions.AggressiveInlining), AssertionMethod, ContractAnnotation("null => false")]
public static bool IsNotNull(UnityEngine.Object obj)
{
return !obj.IsUnityNull();
}
[MethodImpl(MethodImplOptions.AggressiveInlining), AssertionMethod, ContractAnnotation("null => true")]
public static bool IsNotNull(object obj)
{
return obj != null;
}
}
}