public static void Restart() { if (!_isPaused) { for (int i = 0; i < _squares.Count; i++) { _squares[i].Destroy(); _poolObject.Add(_squares[i]); //_squares[i].instance.SetActive(false); } _squares.Clear(); _deaths++; if (_deaths >= _deathsToInterstitial) { _deaths = 0; GameAds.ShowInterstitial(); } TimeManager.AddTimer(OnEndTimerRestart, null, false, Time.time, 0, Time.time + 1.5f); _isPaused = true; _squares.RemoveRange(0, _squares.Count); } else { _isPaused = false; Restart(); } }
private void Awake() { GameAds.Init(); AudioManager.Init(); UIManager.Init(); StateManager.Init(); DataManager.Init(); GameManager.Init(); }