public void GameOver() { this.manager.GameOver(); // this.gameObject.SetActive(false); CancelInvoke("RegisterFlip"); switch (this.mode) { case GameplayMode.Runner: if (PrefsManager.GetCurrentBottleFlipsCount() > PrefsManager.GetBestBottleFlipCount()) { PrefsManager.SetBestBottleFlipCount(PrefsManager.GetCurrentBottleFlipsCount()); } break; case GameplayMode.StaticDump: if (PrefsManager.GetCurrentBottleDumps() > PrefsManager.GetBestBottleDumpCount()) { PrefsManager.SetBestBottleDumpCount(PrefsManager.GetCurrentBottleDumps()); Social.ReportScore((int)(PrefsManager.GetBestBottleDumpCount()), "CgkIkO25l88cEAIQAQ", (bool success) => { }); } this.enabled = false; Debug.Log("gaaaame"); break; } }
void OnEnable() { if (this.CurrentSuccessfullFlips) { this.CurrentSuccessfullFlips.text = PrefsManager.GetCurrentBottleFlipsCount().ToString(); } if (BestSuccessfullFlips) { this.BestSuccessfullFlips.text = PrefsManager.GetBestBottleFlipCount().ToString(); } if (CurrentCoins) { this.CurrentCoins.text = PrefsManager.GetCurrentGamePlayCoins().ToString(); } if (BestCoins) { this.BestCoins.text = PrefsManager.GetBestCoins().ToString(); } if (CurrentDistance) { this.CurrentDistance.text = ((int)this.manager.TotalDistance).ToString() + "m"; } if (BestDistance) { this.BestDistance.text = PrefsManager.GetHighestDistance().ToString() + "m"; } if (TotalCoins) { this.TotalCoins.text = PrefsManager.GetTotalCoins().ToString(); } if (this.BottleFlipCounts) { this.BottleFlipCounts.text = PrefsManager.GetBottleFlipGameCount().ToString(); } if (this.DumpBottleCounts) { this.DumpBottleCounts.text = PrefsManager.GetDumpBottleGameCount().ToString(); } }