mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-20 09:24:32 -05:00
Postgame updates
Added models to post game scene
This commit is contained in:
@@ -10,7 +10,7 @@ public class Bumper : MonoBehaviour {
|
||||
void OnTriggerEnter(Collider objectHit) {
|
||||
if (objectHit.gameObject.tag == "ArcherTarget") {//Checks if the other object is the player
|
||||
|
||||
Debug.Log("Bump");
|
||||
//Debug.Log("Bump");
|
||||
MoveStateManager playerMovement = objectHit.GetComponent<MoveStateManager>();
|
||||
|
||||
Vector3 dirBump = objectHit.transform.position - transform.position;
|
||||
|
||||
@@ -41,28 +41,39 @@ public class PostGameUI : NetworkBehaviour {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool[] active = { false, false, false };
|
||||
if (winnerCount > 0) {
|
||||
// Runners win
|
||||
switch (winnerCount) {
|
||||
case 1:
|
||||
winText = "And the winner is the Runner " + playerFinishedNames[0] + "!";
|
||||
active[1] = true;
|
||||
player1.SetActive(active[1]);
|
||||
break;
|
||||
case 2:
|
||||
winText = "And the winners are the Runners " + playerFinishedNames[0] + " and " + playerFinishedNames[1] + "!";
|
||||
active[1] = true;
|
||||
active[2] = true;
|
||||
player1.SetActive(active[1]);
|
||||
player2.SetActive(active[2]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// King wins
|
||||
winText = "And the winner is King " + kingName + "!";
|
||||
active[0] = true;
|
||||
king.SetActive(active[0]);
|
||||
}
|
||||
|
||||
UpdateWinnerTextClientRPC(winText);
|
||||
UpdateWinnerTextClientRPC(winText, active);
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
private void UpdateWinnerTextClientRPC(string winnerText) {
|
||||
private void UpdateWinnerTextClientRPC(string winnerText, bool[] active) {
|
||||
HeaderText.text = winnerText;
|
||||
king.SetActive(active[0]);
|
||||
player1.SetActive(active[1]);
|
||||
player2.SetActive(active[2]);
|
||||
}
|
||||
|
||||
IEnumerator BeginCountdown() {
|
||||
|
||||
Reference in New Issue
Block a user