3 namespace HKI.Core.Assertions
17 public static void IsNotNull<T>(
UnityEngine.Object obj,
string variableName,
string parentObjectName = null)
21 if (
string.IsNullOrEmpty(parentObjectName))
22 Debug.LogError(
"The variable with the name \"" + variableName +
"\" of the type \"" + typeof(T).Name +
"\" is null");
24 Debug.LogError(
"(" + parentObjectName +
") The variable with the name \"" + variableName +
"\" of the type \"" + typeof(T).Name +
"\" is null");
35 public static void IsNull<T>(
UnityEngine.Object obj,
string variableName,
string parentObjectName = null)
39 if (
string.IsNullOrEmpty(parentObjectName))
40 Debug.LogError(
"The variable with the name \"" + variableName +
"\" of the type \"" + typeof(T).Name +
"\" is not null");
42 Debug.LogError(
"(" + parentObjectName +
") The variable with the name \"" + variableName +
"\" of the type \"" + typeof(T).Name +
"\" is not null");
52 public static void IsTrue(
bool value,
string variableName,
string parentObjectName = null)
56 if (
string.IsNullOrEmpty(parentObjectName))
57 Debug.LogError(
"The variable with the name \"" + variableName +
"\" of the type \"bool\" is not true");
59 Debug.LogError(
"(" + parentObjectName +
") The variable with the name \"" + variableName +
"\" of the type \"bool\" is not true");
69 public static void IsFalse(
bool value,
string variableName,
string parentObjectName = null)
73 if (
string.IsNullOrEmpty(parentObjectName))
74 Debug.LogError(
"The variable with the name \"" + variableName +
"\" of the type \"bool\" is not false");
76 Debug.LogError(
"(" + parentObjectName +
") The variable with the name \"" + variableName +
"\" of the type \"bool\" is not false");
static void IsTrue(bool value, string variableName, string parentObjectName=null)
Check if a bool is true
static void IsFalse(bool value, string variableName, string parentObjectName=null)
Check if a bool is false
Static class for unifying error msg (of standard checks) of HKI Core in Unity