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(); } }
static void Test1(List <TestCase> cases, TimeManager mgr) { var maxTick = cases.Max(c => c.Tick); var results = new HashSet <uint>(); foreach (var c in cases) { TestCase c1 = c; mgr.AddTimer(c.Tick, (timer, data) => { if (mgr.FixedTicks == c1.Tick) { results.Add((uint)data[0]); } }, c.Id); } var begin = DateTime.Now; for (int i = 0; i < maxTick + 1; i++) { mgr.FixedTick(); } var end = DateTime.Now; Console.WriteLine("TimeManagerCount:{0}, Time:{1}", results.Count, end - begin); }
public void Destroy() { PlayAnim(Enumerators.SquareAnimType.DESTROY); //Object.Destroy(_instance, 3); TimeManager.AddTimer(OnTimerDesyroyEnd, null, false, Time.time, 0, Time.time + 3); }