Exemplo n.º 1
0
    //Room

    private void CreateOrJoinRoom(bool IsSender)
    {
        OnFriends  = true;
        cancle     = false;
        startTimer = false;

        //if (!PhotonNetwork.InLobby)
        //    PhotonNetwork.JoinLobby(TypedLobby.Default);
        LoadingImage.SetActive(false);
        PanelRequests.SetActive(false);

        cancle = false;
        MainMenuCanvas.SetActive(false);
        WaitForCanvas.SetActive(true);



        string[] ExpectedUser = new string[1];
        ExpectedUser[0] = SENDER_ID;

        RoomOptions roomOptions = new RoomOptions();

        roomOptions.MaxPlayers    = 4;
        roomOptions.PublishUserId = true;
        PhotonNetwork.JoinOrCreateRoom(ROOM_NAME, roomOptions, TypedLobby.Default, ExpectedUser);
    }
Exemplo n.º 2
0
 public override void OnJoinedLobby()
 {
     if (OnNormalPlay)
     {
         cancle = false;
         mainmenuCanvas.SetActive(false);
         WaitForCanvas.SetActive(true);
         PhotonNetwork.JoinRandomRoom();
     }
 }
Exemplo n.º 3
0
 public void OnClickCancle()
 {
     OnNormalPlay = false;
     if (PhotonNetwork.InRoom)
     {
         cancle = true;
         PhotonNetwork.CurrentRoom.IsVisible = false;
         PhotonNetwork.LeaveRoom();
         mainmenuCanvas.SetActive(true);
         WaitForCanvas.SetActive(false);
     }
     else
     {
         cancle = true;
         mainmenuCanvas.SetActive(true);
         WaitForCanvas.SetActive(false);
         PhotonNetwork.LeaveRoom();
         PhotonNetwork.LeaveLobby();
     }
     ExitRoom = true;
 }