public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer) { LobbyPlayer lobby = lobbyPlayer.GetComponent <LobbyPlayer>(); Movt localPlayer = gamePlayer.GetComponent <Movt>(); localPlayer.pName = lobby.playerName; localPlayer.PlayerColor = lobby.playerColor; Debug.Log("Player Color" + localPlayer.PlayerColor); }
void RpcRespawn() { ChooseBuffPanel.SetActive(true); //Debug.Log(GetColor.PlayerColor+"Respawning"); GetColor = this.GetComponent <Movt>(); PC4Respawn = GetColor.PlayerColor; if (isLocalPlayer) { if (PC4Respawn == Color.blue) { this.transform.position = new Vector2(-18f + UnityEngine.Random.Range(0, 8f), 28.45f); } if (PC4Respawn == Color.red) { this.transform.position = new Vector2(49.9f + UnityEngine.Random.Range(0, 8f), 28.45f); } } }