void Awake()
        {
            if(_instance == null)
            {
                _instance = this;
                DontDestroyOnLoad(this.gameObject);
            }
            else if(_instance != this)
            {
                Destroy(this.gameObject);
            }

            _win = this.GetComponent<Canvas>();
            _bubble = transform.FindChild("LoadingBubble").GetComponent<Image>();

            Data.GameManager.Load(_levelToLoad);
        }
Example #2
0
        void Awake()
        {
            if(instance == null)
            {
                instance = this;
                DontDestroyOnLoad(this.gameObject);
            }
            else if(instance != this)
            {
                Destroy(this.gameObject);
                return;
            }

            win = this.GetComponent<Canvas>();
            loadingCard = GameObject.Find("Loading Card").transform;
            randomCard = GameObject.Find("Random Card").transform;
            randomCard.gameObject.SetActive(false);

            allCards = FindObjectOfType<CardList>().Cards;

            Init();

            LoadLevel(levelToLoad);
        }