Created
January 13, 2019 13:28
-
-
Save SeppahBaws/bca394e159f71bdfd5335613f50b1bc4 to your computer and use it in GitHub Desktop.
Revisions
-
SeppahBaws created this gist
Jan 13, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ public static class Utils { public static bool NullCheck(this object obj, string msg = "") { if (obj == null) { if (msg != "") Debug.LogError(msg); return true; } return false; } } // --- Usage: --- Transform someObj = transform.Find("SomeChild"); if (someObj.NullCheck("someObj not found!")) return; // do stuff with someObj // ...