Answers for "check c# unity inspector field not null"

C#
0

check c# unity inspector field not null

public static bool IsNull<T>(this T myObject, string message = "") where T : class
{
    if (myObject is UnityEngine.Object obj)
    {
        if (!obj)
        {
            Debug.LogError("The object is null! " + message);
            return false;
        }
    }
    else
    {
        if (myObject == null)
        {
            Debug.LogError("The object is null! " + message);
            return false;
        }
    }

    return true;
}
Posted by: Guest on July-18-2020

Code answers related to "check c# unity inspector field not null"

C# Answers by Framework

Browse Popular Code Answers by Language