• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RoomOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RoomOptions的典型用法代码示例。如果您正苦于以下问题:C# RoomOptions类的具体用法?C# RoomOptions怎么用?C# RoomOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RoomOptions类属于命名空间,在下文中一共展示了RoomOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ConnectToRoom

	private void ConnectToRoom()
	{		
		//		if(PhotonNetwork.playerList.Length % 2 != 0)
		//		{
		//			RoomOptions roomOptions = new RoomOptions() { isVisible = true, maxPlayers = 2 };
		//			PhotonNetwork.JoinOrCreateRoom("roomName", roomOptions, TypedLobby.Default);
		
		RoomOptions newRoomOptions = new RoomOptions();
		newRoomOptions.isOpen = true;
		newRoomOptions.isVisible = true;
		newRoomOptions.maxPlayers = 2;
		
		if(ps.type == PlayerType.PC)
		newRoomOptions.customRoomProperties = new ExitGames.Client.Photon.Hashtable() { { "PC", false } };
		else
		newRoomOptions.customRoomProperties = new ExitGames.Client.Photon.Hashtable() { { "VR", false } };
		
		//			newRoomOptions.customRoomPropertiesForLobby = new string[] { "C0" }; // this makes "C0" available in the lobby
		
		// let's create this room in SqlLobby "myLobby" explicitly
		//			TypedLobby sqlLobby = new TypedLobby("myLobby", LobbyType.SqlLobby);
		//			PhotonNetwork.CreateRoom(roomName, newRoomOptions, sqlLobby);
		//			PhotonNetwork.JoinRandomRoom(newRoomOptions.customRoomProperties, newRoomOptions.maxPlayers = 2);
		//		}	
		PhotonNetwork.JoinOrCreateRoom("room" + PhotonNetwork.countOfRooms, newRoomOptions, TypedLobby.Default);
	}
开发者ID:blackbook2016,项目名称:UnityRepository_4,代码行数:26,代码来源:PhotonManager_GS.cs


示例2: CreateRoom

 public void CreateRoom(string roomname)
 {
     Debug.Log("Creating room " + roomname);
     this.Host = true;
     RoomOptions ro = new RoomOptions() { isVisible = true, maxPlayers = 5 };
     PhotonNetwork.CreateRoom(roomname, ro, TypedLobby.Default);
 }
开发者ID:SHEePYTaGGeRNeP,项目名称:FontysMobileGameJam,代码行数:7,代码来源:PhotonManager.cs


示例3: OnJoinedLobby

	/// <summary>
	/// When we joined the lobby after connecting to Photon, we want to immediately join the demo room, or create it if it doesn't exist
	/// </summary>
	void OnJoinedLobby()
	{
		RoomOptions roomOptions = new RoomOptions (){};
		PhotonNetwork.JoinOrCreateRoom (_room, roomOptions, TypedLobby.Default);
		Debug.Log ("Starting Server");
//		if( isHost == true )
//			return;
//		
//		if( QuitOnLogout == true )
//		{
//			Application.Quit();
//			return;
//		}
//		
//		if( Application.loadedLevelName == _levelName )
//		{
//			RoomOptions roomOptions = new RoomOptions();
//			roomOptions.maxPlayers = 20;
//			
//			PhotonNetwork.JoinOrCreateRoom( _room, roomOptions, TypedLobby.Default );
//			Debug.Log( "Joined Lobby" );
//		}
//		else
//		{
//			//If we join the lobby while not being in the MainMenu scene, something went wrong and we disconnect from Photon
//			PhotonNetwork.Disconnect();
//		}
	}
开发者ID:MiloBuwalda,项目名称:wizard,代码行数:31,代码来源:NetworkController.cs


示例4: OnJoinedLobby

	void OnJoinedLobby()
	{
		Debug.Log("joined lobby");
		
		RoomOptions roomOptions = new RoomOptions() { };
		PhotonNetwork.JoinOrCreateRoom(_room, roomOptions, TypedLobby.Default);
	}
开发者ID:samantas,项目名称:Jamz,代码行数:7,代码来源:NetworkController.cs


示例5: OnJoinedLobby

    void OnJoinedLobby()
    {
        Debug.Log("joined lobby");

        RoomOptions roomOptions = new RoomOptions() {isVisible = true, maxPlayers = 4};
        PhotonNetwork.JoinOrCreateRoom(Room, roomOptions, TypedLobby.Default);
    }
开发者ID:frossdelaqrois,项目名称:Afro_Chicken,代码行数:7,代码来源:NetworkController.cs


示例6: OnJoinedLobby

    //Called if Auto-Join Lobby is true in PhotonServerSettings asset
    void OnJoinedLobby()
    {
        Debug.Log("Joined Lobby");

        RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 2 };
        PhotonNetwork.JoinOrCreateRoom("Game", roomOptions, TypedLobby.Default);
    }
开发者ID:NoManAlone,项目名称:NMA-Unity-Project,代码行数:8,代码来源:GameManager.cs


示例7: OnPhotonRandomJoinFailed

 void OnPhotonRandomJoinFailed()
 {
     Debug.Log("Can't join random room!");
     RoomOptions roomOptions = new RoomOptions();
     roomOptions.MaxPlayers = 0;
     PhotonNetwork.CreateRoom(null, roomOptions, null);
 }
开发者ID:daniel-cheng,项目名称:stellar,代码行数:7,代码来源:NetworkManager.cs


示例8: OnGUI

    void OnGUI()
    {
        GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());

        if (PhotonNetwork.room == null)
        {
            //Create room
            if (GUI.Button(new Rect(50, 50, 200, 50), "Start Server"))
            {
                PhotonNetwork.CreateRoom(roomName + System.Guid.NewGuid().ToString("N"));
            }

            //Join room
            if (roomsList != null)
            {
                for (int i = 0; i < roomsList.Length; i++)
                {
                    if(GUI.Button(new Rect(50, 110 + (10 * i), 200, 50), "Join" + roomsList[i].name))
                    {
                        RoomOptions ro = new RoomOptions() { isVisible = true, maxPlayers = 4 };
                        PhotonNetwork.JoinOrCreateRoom(roomsList[i].name, ro, TypedLobby.Default);
                    }
                }
            }
        }
    }
开发者ID:elluuuh,项目名称:Battle-City,代码行数:26,代码来源:NetworkManager.cs


示例9: OnPhotonJoinRoomFailed

 void OnPhotonJoinRoomFailed()
 {
     Debug.Log("No such room with name : " + roomName + ", creating!");
     RoomOptions roomOptions = new RoomOptions();
         roomOptions.maxPlayers = 2;
     PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
 }
开发者ID:Hoon-Park,项目名称:MMOArenaUnity,代码行数:7,代码来源:MMOArenaPhotonConnector.cs


示例10: OnJoinedLobby

	void OnJoinedLobby(){

		//Don't use these 2 lines if you wan't offline mode to work
		RoomOptions roomOptions = new RoomOptions () { isVisible = false, maxPlayers = 4};
		PhotonNetwork.JoinOrCreateRoom (roomName, roomOptions, TypedLobby.Default);

	}
开发者ID:KarateF22,项目名称:GameX,代码行数:7,代码来源:NetworkManager.cs


示例11: OnJoinedLobby

	/// <summary>
	/// When we joined the lobby after connecting to Photon, we want to immediately join the demo room, or create it if it doesn't exist
	/// </summary>
	void OnJoinedLobby()
	{
		if( isHost == true )
			return;
		
		if( QuitOnLogout == true )
		{
			Application.Quit();
			return;
		}
		
		if( Application.loadedLevelName == _levelName )
		{
			RoomOptions roomOptions = new RoomOptions();
			roomOptions.maxPlayers = 20;
			
			PhotonNetwork.JoinOrCreateRoom( "Wizard", roomOptions, TypedLobby.Default );
			Debug.Log( "Joined Lobby" );
		}
		else
		{
			//If we join the lobby while not being in the MainMenu scene, something went wrong and we disconnect from Photon
			PhotonNetwork.Disconnect();
		}
	}
开发者ID:MiloBuwalda,项目名称:wizard,代码行数:28,代码来源:NetworkController.cs


示例12: OnConnectedToMaster

        void OnConnectedToMaster()
        {
            if (ApplicationModel.NetState == NetSate.Default)
            {
                Debug.Log("JoinRandomRoom");
                PhotonNetwork.JoinRandomRoom(); // création de la room
                return;
            }
            Debug.Log("JoinNanRandomRoom : " + ApplicationModel.NetState);
            string RoomID = ApplicationModel.RoomID;
            if (RoomID != null)
                this.room_name = RoomID;
            else
            {
                Notification.Create(NotificationType.Box, "Erreur lors de l'invitation", content: "Une erreur est survenue lors de la création de la room.");
                return;
            }

            if (ApplicationModel.NetState == NetSate.InviteFriend)
            {
                RoomOptions roomOptions = new RoomOptions() { IsVisible = false /*isVisible = false*/ , MaxPlayers = 2 /*maxPlayers = 2*/}; // isVisible Random can join or not (ici non)
                PhotonNetwork.JoinOrCreateRoom(this.room_name, roomOptions, TypedLobby.Default);
            }
            else if (ApplicationModel.NetState == NetSate.InviteByFriend)
            {
                PhotonNetwork.JoinRoom(this.room_name);
            }
            PlayerPrefs.DeleteAll();

        }
开发者ID:CanPayU,项目名称:SuperSwungBall,代码行数:30,代码来源:NetworkController.cs


示例13: OnConnectedToMaster

 // below, we implement some callbacks of PUN
 // you can find PUN's callbacks in the class PunBehaviour or in enum PhotonNetworkingMessage
 public virtual void OnConnectedToMaster()
 {
     Debug.Log("OnConnectedToMaster() was called by PUN. Now this client is connected and could join a room. Calling: PhotonNetwork.JoinOrCreateRoom();");
     RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 8 };
     PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
     GameObject.Find("Canvas/Room Label").GetComponent<Text>().text = "Room: " + roomName;
 }
开发者ID:Ckeds,项目名称:PortfolioWorks,代码行数:9,代码来源:NetworkManager.cs


示例14: OnJoinedLobby

	void OnJoinedLobby() {
		RoomOptions roomOptions = new RoomOptions() {
			isVisible = false,
			maxPlayers = 4
		};
		PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
	}
开发者ID:rthill91,项目名称:Independent-Study,代码行数:7,代码来源:NetworkManager.cs


示例15: OnPhotonRandomJoinFailed

 public void OnPhotonRandomJoinFailed()
 {
     hostFlag = true;
     RoomOptions roomOptions = new RoomOptions() { isVisible = true, maxPlayers = 2 };
     PhotonNetwork.CreateRoom(null, roomOptions, TypedLobby.Default);
     //PhotonNetwork.CreateRoom(null);
 }
开发者ID:chocopuyo,项目名称:photon_invador,代码行数:7,代码来源:SpacePhotonScript.cs


示例16: OnJoinedLobby

 void OnJoinedLobby()
 {
     Debug.Log("OnJoinedLobby");
     RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 4 };
     PhotonNetwork.JoinOrCreateRoom("FillerRoom-", roomOptions, TypedLobby.Default);
     // + Random.Range(1, 100000)
 }
开发者ID:pShusta,项目名称:TheFellnightPrison,代码行数:7,代码来源:LoginConnection.cs


示例17: OnConnectedToMaster

 void OnConnectedToMaster()
 {
     RoomOptions roomOptions = new RoomOptions();
     roomOptions.isVisible = true;
     roomOptions.maxPlayers = 2;
     PhotonNetwork.JoinOrCreateRoom("testRoom", roomOptions, TypedLobby.Default);
 }
开发者ID:ogmiossa,项目名称:Battleships,代码行数:7,代码来源:ConnectToServer.cs


示例18: OnPhotonRandomJoinFailed

    void OnPhotonRandomJoinFailed()
    {
        RoomOptions roomOptions = new RoomOptions() { isVisible = true, maxPlayers = 2 };
        PhotonNetwork.CreateRoom(null,roomOptions,TypedLobby.Default);
        Gameplay.instance.maxPoints = 5;

    }
开发者ID:lopezmramon,项目名称:MultiPong,代码行数:7,代码来源:RandomMatchmaker.cs


示例19: CreateRoom

 public void CreateRoom()
 {
     string RoomName = createRoomInput.text;
     byte roomPlayersMax = byte.Parse (createRoomInputPlayers.text);
     //Validation for name and playerMAX
     if (RoomName.Length > 5)
     {
         if (roomPlayersMax > 0)
         {
             RoomOptions newroomoptions = new RoomOptions()
             {
                 maxPlayers = roomPlayersMax,
                 isOpen =true,
                 isVisible = true
             };
             PhotonNetwork.JoinOrCreateRoom(RoomName,newroomoptions,TypedLobby.Default);
         }
         else
         {
             Debug.Log("Room Max Player fails");
         }
     }
     else
     {
         Debug.Log("Roomname fails");
     }
 }
开发者ID:tunderix,项目名称:LittleFishers,代码行数:27,代码来源:MainMenu.cs


示例20: OnTouchDown

 void OnTouchDown()
 {
     RoomOptions option = new RoomOptions ();
     option.isOpen = true;
     option.isVisible = true;
     option.maxPlayers = 10;
     PhotonNetwork.CreateRoom (roomName, option, null);
 }
开发者ID:lagane100,项目名称:APPgame,代码行数:8,代码来源:create_room.cs



注:本文中的RoomOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RoomUser类代码示例发布时间:2022-05-24
下一篇:
C# RoomItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap