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(); } }
public void GameOver() { if (PrefsManager.GetCurrentGamePlayCoins() > PrefsManager.GetBestCoins()) { PrefsManager.SetBestCoins(PrefsManager.GetCurrentGamePlayCoins()); } Debug.Log("Game Over"); // PrefsManager.AddToTotalCoins(); int HD = PrefsManager.GetHighestDistance(); //if (this.TotalDistance > HD) //{ // PrefsManager.SetHighestDistance((int)this.TotalDistance); // ///Debug.Log("Highest Distance: " + PrefsManager.GetHighestDistance().ToString()); // /// Put leaderboard client ID in place of CLIent ID here // Social.ReportScore((int)(PlayerPrefs.GetInt("HighestDistance")), "Client ID here", (bool success) => { // }); //} this.uiHandler.GameOverPanel.SetActive(true); }