Esempio n. 1
0
    /// <summary>
    /// Prepare Money Manager
    /// </summary>
    private void Start()
    {
        GameModeManager _mode = FindObjectOfType <GameModeManager>();

        if (!_mode)
        {
            Log.WriteLog("Can not set game mode." + gameMode.ToString() + ".", Log.LevelsOfLogs.ERROR, "ScoreManager");
        }
        gameMode = _mode.GetGameMode();
        Log.WriteLog("Set game mode: " + gameMode.ToString() + ".", Log.LevelsOfLogs.INFO, "ScoreManager");
        // Get best score of current mode
        switch (gameMode)
        {
        case GameModes.Modes.Classic:
            bestScore = PlayerPrefs.GetInt(PlayerPrefsKeys.BestScoreClassic);
            break;

        case GameModes.Modes.Challenge:
            bestScore = PlayerPrefs.GetInt(PlayerPrefsKeys.BestScoreChallenge);
            break;
        }
        Log.WriteLog("Best score: " + bestScore + ".", Log.LevelsOfLogs.INFO, "ScoreManager");

        var uiUpdater = FindObjectOfType <GameLoopUIUpdate>();

        updateScoreUI += uiUpdater.UpdateGameScoreUI;
        updateLoseUI  += uiUpdater.UpdateLoseUI;

        updateScoreUI?.Invoke(new ScoreUpdateUIEventArgs(0));
    }
Esempio n. 2
0
    private void Start()
    {
        money   = PlayerPrefs.GetInt(PlayerPrefsKeys.Money);
        gems    = PlayerPrefs.GetInt(PlayerPrefsKeys.Gems);
        tickets = PlayerPrefs.GetInt(PlayerPrefsKeys.TicketsForEnterToChallenge);

        GameModeManager _mode = FindObjectOfType <GameModeManager>();

        if (_mode)
        {
            gameMode = _mode.GetGameMode();
        }

        //var updateUI = FindObjectOfType<GameLoopUIUpdate>();
        //SetEvents(updateUI.UpdateMoneyUI, updateUI.UpdateGemsUI, updateUI.UpdateTicketsUI);
    }
Esempio n. 3
0
 public static void SetMode(GameModes.Modes newMode) => mode = newMode;
Esempio n. 4
0
 public Escape(Modes plugin) => this.plugin = plugin;