Exemple #1
0
    public void CreateRoom(CustomRoom room)
    {
        if (!PhotonNetwork.IsConnected)
        {
            return;
        }
        RoomOptions option = new RoomOptions();

        option.MaxPlayers = (byte)room.maxPlayers;
        PhotonNetwork.CreateRoom(room.roomName, option, TypedLobby.Default);
    }
 private void Awake()
 {
     if (CustomRoom.room == null)
     {
         CustomRoom.room = this;
     }
     else
     {
         if (CustomRoom.room != this)
         {
             Destroy(CustomRoom.room.gameObject);
             CustomRoom.room = this;
         }
     }
     DontDestroyOnLoad(this.gameObject);
 }