internal void AddToCurrentPlayerScore(ScoreKey toAdd) { if (CurrentPlayer == 1) { AddToPlayerOneScore(toAdd); } else { AddToPlayerTwoScore(toAdd); } }
// Called from another place, this will add score based on the Palette to the correct player internal void AddToCurrentPlayerScore(ScoreKey toAdd) { // Checks which player is playing to add score to if (CurrentPlayer == Constants.PLAYER_ONE) { AddToPlayerOneScore(toAdd); } else { AddToPlayerTwoScore(toAdd); } // If you have served 20 customers but the level hasn't been won yet // Set the level to won and set the level to the next level, add level finish bonus and start the next level if (HappyCustomer >= Constants.PROMOTION && !LevelWon) { LevelWon = true; levelManager.level++; AddToCurrentPlayerScore(ScoreKey.LevelFinish); StartCoroutine("NextLevel"); } }
// Adds score to Player Two according to the Score Palette internal void AddToPlayerTwoScore(ScoreKey toAdd) { PlayerTwoScore += ScoreTable[toAdd]; levelUIManager.SetPlayerTwoScoreText(PlayerTwoScore); }