private IEnumerator StartPhotonGameEnumerator() { // Chat Setup yield return(chatController.InitEnumerator()); // instantiate and init the player with position and rotation specified. int id = GetVacantSlotID(); myPlayer = PhotonNetwork.Instantiate( photonPlayerPrefab.name, spawnPoints[id].position, Quaternion.identity, 0) .GetComponent <PhotonPlayer>(); myPlayer.Init(id); // notice to all players that my player's spawn point is now occupied view.RPC(RPC_SET_OCCUPIED_METHOD_NAME, RpcTarget.AllBuffered, id); // Enable User-Controllable UIs gameDefaultUIRoot.SetActive(true); controlButtonRoot.SetActive(true); }