Beispiel #1
0
        private void Awake()
        {
            if (instance)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;
        }
Beispiel #2
0
        // ============================================================================
        //							  ***** 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);
        }