private void updateScore() { // TODO: figure out active player num for when more than one player timerText.text = "Time Remaining: " + FareTools.roundTwoDecimals(MissionTimer.TimeRemaining()); playerText.text = "Player 1"; scoresText.text = ""; for (int i = 0; i < players.Length; i++) { FarePlayerController fpc = players [i].playerCustomer.farePlayerController; scoresText.text += "Player " + (i + 1) + ": $" + fpc.money; if (null != fpc.fare) { scoresText.text += " Charge: $" + fpc.charge + "\n"; } else { if (i == 0) { fareText.text = ""; } scoresText.text += "\n"; } if (i == 0 && null != fpc.fareResponse) { fareText.text += " \"" + fpc.fareResponse.verbal + "\""; } } }
private string EndMessage() { string message = "MISSION OVER!"; int winningPlayer = 1; float winningScore = 0f; for (int i = 0; i < players.Length; i++) { FarePlayerController fpc = players [i].playerCustomer.farePlayerController; if (fpc.money > winningScore) { winningPlayer = i + 1; winningScore = fpc.money; } } if (winningScore < 1.0f) { message += "\nNobody " + winningPlayer + " Wins..."; } else { message += "\nPlayer " + winningPlayer + " Wins!"; } return(message); }
void Awake() { // Initialize References rb = GetComponent <Rigidbody>(); farePlayerController = farePlayerControllerObj.GetComponent <FarePlayerController> (); compass = GetComponent <Compass>(); aiController = GetComponentInParent <RickshawAIControl>(); }