IEnumerator Respawn() { SceneTextsManager STM = GameObject.Find("GameManager").GetComponent <SceneTextsManager>(); gameObject.GetComponent <PhotonView>().RPC("ActivateDeactivatePlayerModel", RpcTarget.AllBuffered, false); ActivateDeactivateComponents(false); int randomX = Random.Range(370, 400); int randomZ = Random.Range(90, 110); transform.position = new Vector3(randomX, 50, randomZ); if (photonView.IsMine) { STM.respawnText.text = "You are dead. Respawning soon"; } yield return(new WaitForSeconds(7.0f)); gameObject.GetComponent <PhotonView>().RPC("ActivateDeactivatePlayerModel", RpcTarget.AllBuffered, true); if (photonView.IsMine) { STM.respawnText.text = ""; playerUI.SetActive(false); } ActivateDeactivateComponents(true); }
IEnumerator Respawn() { SceneTextsManager STM = GameObject.Find("GameManager").GetComponent <SceneTextsManager>(); gameObject.GetComponent <PhotonView>().RPC("ActivateDeactivatePlayerModel", RpcTarget.AllBuffered, false); transform.GetComponent <MovementController>().enabled = false; transform.GetComponent <Rigidbody>().isKinematic = true; int randomX = Random.Range(0, 50); int randomZ = Random.Range(-10, 10); transform.position = new Vector3(randomX, 50, randomZ); if (photonView.IsMine) { STM.respawnText.text = "You are dead. Respawning soon"; } yield return(new WaitForSeconds(7.0f)); if (photonView.IsMine) { STM.respawnText.text = ""; } gameObject.GetComponent <PhotonView>().RPC("ActivateDeactivatePlayerModel", RpcTarget.AllBuffered, true); transform.GetComponent <MovementController>().enabled = true; transform.GetComponent <Rigidbody>().isKinematic = false; }
void SetGameSceneUI() { if (photonView.IsMine) { SceneTextsManager STM = GameObject.Find("GameManager").GetComponent <SceneTextsManager>(); STM.youText.text = "Player: " + PhotonNetwork.NickName; STM.weaponText.text = "Weapon: " + (string)photonView.Owner.CustomProperties["Weapon"]; //STM.hitCountingText.text = "Hits: " + (string)photonView.Owner.CustomProperties["Hits"]; STM.deathCountingText.text = "Deaths: " + (string)photonView.Owner.CustomProperties["Deaths"]; } }