Ejemplo n.º 1
0
        void Update()
        {
            if (IsScreenVisible())
            {
                if (PhotonNetwork.connected)
                {
                    if (PhotonNetwork.inRoom)
                    {
                        UILobby.HideScreen();
                        UIRoom.ShowScreen();
                    }
                    else if (PhotonNetwork.insideLobby)
                    {
                        UpdateRoomList(PhotonNetwork.GetRoomList());
                    }
                }
                else
                {
                    UIDialog.Show("Disconnected From Photon");

                    UILobby.HideScreen();
                    UIConnect.ShowScreen();
                }
            }
        }
Ejemplo n.º 2
0
        public void OnConnectClicked()
        {
            if (String.IsNullOrEmpty(Username.text.Trim()))
            {
                UIDialog.Show("You need to enter a username");
                return;
            }

            PhotonNetwork.player.NickName = Username.text;
            PhotonNetwork.autoJoinLobby   = true;
            PhotonNetwork.ConnectUsingSettings(GameVersion);

            UIConnect.HideScreen();
            UIConnecting.ShowScreen();
        }
Ejemplo n.º 3
0
        public void OnCreateClicked()
        {
            if (String.IsNullOrEmpty(RoomName.text.Trim()))
            {
                UIDialog.Show("You must enter a room name");
                return;
            }

            if (String.IsNullOrEmpty(PlayerCount.text.Trim()))
            {
                UIDialog.Show("You must enter a max player count");
                return;
            }

            RoomOptions roomOptions = new RoomOptions();

            roomOptions.IsVisible  = true;
            roomOptions.MaxPlayers = Byte.Parse(PlayerCount.text);

            PhotonNetwork.CreateRoom(RoomName.text, roomOptions, TypedLobby.Default);
        }
Ejemplo n.º 4
0
 public void OnPhotonJoinRoomFailed(object[] codeAndMsg)
 {
     UIDialog.Show("Room Join Failed");
 }
Ejemplo n.º 5
0
 public void OnPhotonCreateRoomFailed(object[] codeAndMsg)
 {
     UIDialog.Show("Room Creation Failed");
 }