// Update is called once per frame void Update() { if (hostController != null && clientController != null) { if (hostController.isLocalPlayer) { localText.text = clientScore.ToString(); remoteText.text = hostScore.ToString(); } else { if (!switchColor) { switchColor = true; Color tempColor = localText.color; localText.color = remoteText.color; localText.transform.parent.GetComponent <TextMesh>().color = remoteText.color; remoteText.color = tempColor; remoteText.transform.parent.GetComponent <TextMesh>().color = tempColor; } localText.text = clientScore.ToString(); remoteText.text = hostScore.ToString(); } } if (hit) { if (respTimer > 0) { respTimer += -Time.deltaTime; } else { hit = false; // Restore players/dummies if (GameObject.ReferenceEquals(lastHitPlayer, hostPlayer)) { hostController.Restore(); } else if (GameObject.ReferenceEquals(lastHitPlayer, clientPlayer)) { clientController.Restore(); } else { dummyController.Restore(); } // Respawn disks hostDiskController.Respawn(); if (clientDiskController != null) { clientDiskController.Respawn(); } } } if (gameOver) { exitTimer += -Time.deltaTime; if (exitTimer < 0f) { SceneManager.LoadScene("MenuRoom"); } } }