public static SGT_LightSource Find() { if (instance != null) { return(instance); } instance = SGT_Helper.Find <SGT_LightSource>(); return(instance); }
public static void RequireInstance() { if (instance == null) { instance = SGT_Helper.Find <T>(); if (instance == null) { new GameObject(typeof(T).Name).AddComponent <T>(); if (instance == null) { Debug.LogError("Something went wrong!"); } } } }