Exemplo n.º 1
0
    void GameOver(Player winner)
    {
        Debug.Log("Winner: " + winner.ToString());
        //SpewCoins();
        //ShowBigWin();
        HUD.ShowWinner(winner);
        IsInputEnabled = false;
        IsGameRunning  = false;

        if (IsSimulatedGame)
        {
            botManager.GameOver(winner);
            StartCoroutine(IE_RestartAfterDelay(.1f));
        }

        if (IsLocalGame || winner == LocalPlayer)
        {
            SaveWin();
        }
        else if (winner != LocalPlayer && winner != Player.NONE)
        {
            SaveLoss();
        }
        Debug.Log($"Scores Saved.\n OnlineWins:{OnlineWins} OnlineLosses:{OnlineLosses} LocalWins:{LocalWins} BotWins:{BotWins} BotLosses:{BotLosses}");
        PlayerPrefs.Save();
    }