Postgame updates

Added models to post game scene
This commit is contained in:
Vincent Wheat
2022-04-27 16:20:39 -05:00
parent 469953bf16
commit 72ed4e2cd9
4 changed files with 10546 additions and 57 deletions

View File

@@ -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;

View File

@@ -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() {