Ejemplo n.º 1
0
        private void Awake()
        {
            map = SetMapController.GetMap();
            maps[map].SetActive(true);

            wins             = SetWinsController.GetWins();
            targetScore.text = wins.ToString();
            playerOneScore   = 0;
            playerTwoScore   = 0;

            playerOneScoreText.text = "0";
            playerTwoScoreText.text = "0";

            onPlayerDeath += PlayerDeathEvent;
        }
Ejemplo n.º 2
0
 public override void OnJoinedRoom()
 {
     if (PhotonNetwork.IsMasterClient)
     {
         playerOneName.text = PhotonNetwork.PlayerList[0].NickName;
         playerTwoName.text = "";
         toSkillSelectionButton.GetComponent <Button>().interactable = false;
     }
     else
     {
         playerOneName.text = PhotonNetwork.PlayerList[0].NickName;
         playerTwoName.text = PhotonNetwork.PlayerList[1].NickName;
         SetMapController.SetMap((int)PhotonNetwork.CurrentRoom.CustomProperties["map"]);
         SetWinsController.SetWins((int)PhotonNetwork.CurrentRoom.CustomProperties["wins"]);
         toSkillSelectionButton.SetActive(false);
     }
     panelsController.SetPanelActive("Room Panel");
 }
Ejemplo n.º 3
0
        public void OnCreateRoomButtonClicked()
        {
            string roomName = PlayerPrefs.GetString("Nickname", "") + "'s room";

            var roomOptions = new RoomOptions();

            Hashtable properties = new Hashtable()
            {
                { "wins", SetWinsController.GetWins() }, { "map", SetMapController.GetMap() }
            };

            roomOptions.CustomRoomProperties         = properties;
            roomOptions.CustomRoomPropertiesForLobby = new string[] { "wins", "map" };

            roomOptions.MaxPlayers = 2;

            PhotonNetwork.CreateRoom(roomName, roomOptions, TypedLobby.Default);
        }