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 + "\""; } } }
void Update() { if (null != fare) { pathDistance += Vector3.Distance(transform.position, lastPosition); lastPosition = transform.position; charge = FareTools.roundTwoDecimals(pathDistance * pricePerMile); } }