public BehaviorTreeStateDebugger() { if (_Instance != null) { Debug.LogError("Trying to create two instances of singleton. Self destruction in 3..."); Destroy(this); return; } _Instance = this; titleContent = new GUIContent("BT State"); position = new Rect((Screen.width - Size.x) / 2.0f, (Screen.height - Size.y) / 2.0f, Size.x, Size.y); base.minSize = Size; CreateUI(); }
public void OnDestroy() { _Instance = null; }