Ejemplo n.º 1
0
 private void OnPlayerNumberingChanged()
 {
     foreach (Player p in PhotonNetwork.PlayerList)
     {
         if (p.ActorNumber == ownerId)
         {
             PlayerColorImage.color = ClipperGate.GetColor(p.GetPlayerNumber());
         }
     }
 }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
 void Start()
 {
     color1 = ClipperGate.GetColor(GetComponentInParent <PhotonView>().Owner.GetPlayerNumber());
     color2 = ClipperGate.GetColor2(GetComponentInParent <PhotonView>().Owner.GetPlayerNumber());
 }
Ejemplo n.º 4
0
        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);
                });
            }
        }
Ejemplo n.º 5
0
 public void Initialize(int playerId, string playerName, string playerScore)
 {
     PlayerColorImage.color = ClipperGate.GetColor(playerId);
     PlayerNameText.text    = playerName;
     PlayerScoreText.text   = playerScore;
 }