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