private void Awake() { if (instance) { Destroy(gameObject); return; } instance = this; }
// ============================================================================ // ***** DESTROY ***** // ============================================================================ private void OnDestroy() { if (this == instance) { instance = null; } for (int i = 0; i < squadCards.Count; i++) { squadCards[i].OnSelected -= SelectionSquadCard_OnSelected; } BackButton.onClick.RemoveListener(OnBackButton_Clicked); PlayButton.onClick.RemoveListener(OnPlayButton_Clicked); }