/* * @NOTE(sdsmith): This includes both your local client's player and * network client players. */ public void SpawnMyPlayer() { tm.AddSpawnMessage(PhotonNetwork.player.NickName); // Set the spawn point based on the team you're on GameObject spawnPoint = Util.GetSpawnPoint(PhotonNetwork.player.GetTeam()); if (spawnPoint == null) { Debug.LogError("Spawn point is null"); } GameObject myPlayerGO = (GameObject)PhotonNetwork.Instantiate(prefabName, spawnPoint.transform.position, spawnPoint.transform.rotation, 0); standbyCamera.SetActive(false); // Set referance to the local player // @TODO(sdsmith): Confirm that this always spawns out local player if (myPlayerGO.GetComponent <PhotonView>().owner.IsLocal) { Util.localPlayer = myPlayerGO; } // Enable player scripts ToggleComponents(myPlayerGO); int viewID = myPlayerGO.gameObject.GetPhotonView().viewID; GetComponent <PhotonView>().RPC("SetTeamIcon", PhotonTargets.AllBuffered, viewID); }