private void OnPlayerNumberingChanged() { foreach (Player p in PhotonNetwork.PlayerList) { if (p.ActorNumber == ownerId) { PlayerColorImage.color = ClipperGate.GetColor(p.GetPlayerNumber()); } } }
public void SelectedCharacter(Dropdown choice) { Hashtable props = new Hashtable() { { ClipperGate.CHOSEN_CHARACTER, ClipperGate.GetCharacter(choice.value) } }; PhotonNetwork.LocalPlayer.SetCustomProperties(props); print(ClipperGate.GetCharacter(choice.value)); if (PhotonNetwork.IsMasterClient) { FindObjectOfType <Lobby>().LocalPlayerPropertiesUpdated(); } }
void Start() { color1 = ClipperGate.GetColor(GetComponentInParent <PhotonView>().Owner.GetPlayerNumber()); color2 = ClipperGate.GetColor2(GetComponentInParent <PhotonView>().Owner.GetPlayerNumber()); }
public void Start() { if (PhotonNetwork.LocalPlayer.ActorNumber != ownerId) { PlayerReadyButton.gameObject.SetActive(false); PlayerCharacterSelect.gameObject.SetActive(false); } else { Hashtable initialProps = new Hashtable() { { ClipperGate.PLAYER_READY, isPlayerReady }, { ClipperGate.PLAYER_HEALTH, ClipperGate.PLAYER_MAX_HEALTH }, { ClipperGate.CHOSEN_CHARACTER, ClipperGate.GetCharacter(0) }, { ClipperGate.PLAYER_SCORE, ClipperGate.PLAYER_START_SCORE } }; PhotonNetwork.LocalPlayer.SetCustomProperties(initialProps); PhotonNetwork.LocalPlayer.SetScore(0); PlayerReadyButton.onClick.AddListener(() => { isPlayerReady = !isPlayerReady; SetPlayerReady(isPlayerReady); Hashtable props = new Hashtable() { { ClipperGate.PLAYER_READY, isPlayerReady } }; PhotonNetwork.LocalPlayer.SetCustomProperties(props); if (PhotonNetwork.IsMasterClient) { FindObjectOfType <Lobby>().LocalPlayerPropertiesUpdated(); } }); PlayerCharacterSelect.onValueChanged.AddListener(delegate { SelectedCharacter(PlayerCharacterSelect); }); } }
public void Initialize(int playerId, string playerName, string playerScore) { PlayerColorImage.color = ClipperGate.GetColor(playerId); PlayerNameText.text = playerName; PlayerScoreText.text = playerScore; }