private void Awake() { if (!instance) { instance = this; } }
public static void Show() { if (!Debug.isDebugBuild) { return; } if (!instance) { GameObject obj = new GameObject(); obj.hideFlags = HideFlags.HideInHierarchy; instance = obj.AddComponent <DebugOnBuild>(); } instance.isVisible = true; }