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

C# UnityEngine.HostData类代码示例

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

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



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

示例1: JoinServer

 private void JoinServer(HostData hostData)
 {
     #if UNITY_ANDROID
     //AndroidJNI.CallIntMethod ();
     #endif
     Network.Connect (hostData);
 }
开发者ID:DormantDreams,项目名称:IMiD-Prototype,代码行数:7,代码来源:NetworkManager.cs


示例2: JoinServer

    private void JoinServer(HostData hostData)
    {
        Network.Connect (hostData);

        recoClient = GameObject.Find ("VoiceTranslation");;
        recoClient.GetComponentInChildren<UDP_RecoServer> ().StartServer ();
    }
开发者ID:Crazedpeanut,项目名称:YellFighter,代码行数:7,代码来源:NetworkManager.cs


示例3: RetrievePing

	public void RetrievePing(HostData host)
	{
		testing = true;
		Network.Connect(host);
		PingLabel.text = "--";
		ip = string.Concat(host.ip);
	}
开发者ID:RobbSteel,项目名称:Lords-of-Distortion,代码行数:7,代码来源:GameEntry.cs


示例4: JoinServer

    private void JoinServer(HostData hostData)
    {
        Debug.Log("Joining to server: "+hostData.gameName+" | "+hostData.ip[0]+":"+hostData.port.ToString());

        clientState=ClientState.ClientJoin;
        Network.Connect(hostData);
    }
开发者ID:Gris87,项目名称:PingPong3D,代码行数:7,代码来源:NetworkManager.cs


示例5: CreateClientButton

        private void CreateClientButton(Type type, HostData hostData, int carNumber, float x, float y)
        {
            Texture2D texture;
            if (carNumber == 0)
            {
                texture = type == typeof(Driver) ? _textureDriverRed : _textureThrottlerRed;
            }
            else
            {
                texture = type == typeof(Driver) ? _textureDriverBlue : _textureThrottlerBlue;
            }

            if (DrawTextureButton(new Rect(x, y, ButtonWidth, ButtonHeight), texture))
            {
                MainScript.SelfType = MainScript.PlayerType.Client;
                MainScript.SelfCar = new Car(carNumber);

                //Based on: http://stackoverflow.com/a/755
                MainScript.SelfPlayer = new Player(MainScript.SelfCar, (IPlayerRole)Activator.CreateInstance(type));
                MainScript.SelfPlayer.Role.Initialize();

                MainScript.Client.ChooseJobWhenConnected(type.Name, carNumber);
                if (hostData == null)
                {
                    Network.Connect(GameData.IP, GameData.PORT);
                }
                else
                {
                    Network.Connect(hostData);
                }
                NetworkController.Connected = true;
            }
        }
开发者ID:KvanNes,项目名称:Contextproject-Group5,代码行数:33,代码来源:MainPart.cs


示例6: OnListItemUnselected

 void OnListItemUnselected(ComboBox.ComboItem unselectedItem)
 {
     if (selectedHost == (HostData)unselectedItem.value)
     {
         selectedHost = null;
     }
 }
开发者ID:niguerrac,项目名称:UnityUI,代码行数:7,代码来源:MasterServerInterface.cs


示例7: SetServer

    public void SetServer(HostData data)
    {
        info = data;

        label.text = data.gameName;
        comment.text = data.comment;
        comment.text += data.connectedPlayers + "/" + data.playerLimit;
    }
开发者ID:Bananenkiste,项目名称:CardGameCreator,代码行数:8,代码来源:ServerButton.cs


示例8: ConnectToServer

 void ConnectToServer(HostData hostData)
 {
     var err = Network.Connect(hostData);
     if (err != NetworkConnectionError.NoError) {
         Debug.Log(string.Format("error initializing server {0}", err));
         return;
     }
 }
开发者ID:mbaranowski,项目名称:UnityTutorial,代码行数:8,代码来源:IntroGUI.cs


示例9: Join

	public void Join(HostData host) {
		if(!host.passwordProtected)
			Network.Connect(host);
		else{
			Protected = true;
			select = host;
		}
	}
开发者ID:MizzKii,项目名称:WarB,代码行数:8,代码来源:MultiPlayer.cs


示例10: HandleOnServerSelected

 void HandleOnServerSelected(HostData selectedServer)
 {
     //When the "Connect" button is pressed in the MasterServerInterface behavior, this is called
     if(selectedServer != null) {
         //Join and hide the host list interface
         JoinServer(selectedServer);
     }
 }
开发者ID:niguerrac,项目名称:UnityUI,代码行数:8,代码来源:ServerHostAndJoin.cs


示例11: JoinServer

 private void JoinServer(HostData hostData)
 {
     GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
     for (int i = 0; i<players.Length; i++)
     {
         Destroy(players[i]);
     }
     Network.Connect(hostData);
 }
开发者ID:razvanilin,项目名称:Nebulae,代码行数:9,代码来源:NetworkManager.cs


示例12: getDebugName

 public static string getDebugName(HostData host)
 {
     string hostName = host.gameType + " " + host.gameName + " " + host.comment + " [" + host.guid + "]";
     string players = "(" + host.connectedPlayers + "/" + host.playerLimit + ")";
     string addresses = "{" + string.Join(":", host.ip) + ":" + host.port + "}";
     string nat = "N:" + host.useNat;
     string password = "P:" + host.passwordProtected;
     return string.Join(" ", new string[] {hostName, players, addresses, nat, password});
 }
开发者ID:alvarogzp,项目名称:nextation,代码行数:9,代码来源:HostDataFormatter.cs


示例13: JoinServer

    private void JoinServer(HostData hostData)
    {
        hostList = null;

        if (selectingIP) {
            Network.Connect (hostData.ip [0], hostData.port);
        } else {
            Network.Connect(hostData);
        }
    }
开发者ID:rvitale,项目名称:RaidBoss,代码行数:10,代码来源:NetworkManager.cs


示例14: Start

 public MyHostData Start(HostData hd)
 {
     this.hd = hd;
     foreach (var ip in hd.ip)
     {
         var p = new Ping(ip);
         pp.Add(p);
     }
     return this;
 }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:10,代码来源:Menu.cs


示例15: JoinGame

 public void JoinGame(HostData hd)
 {
     //Network.Connect(hd);
     //Debug.Log("Turning off SetSendingEnabled");
     //Network.SetSendingEnabled(0, false);
     //Debug.Log("Turning off isMessageQueueRunning");
     //Network.isMessageQueueRunning = false;
     //Debug.Log("Loading main level");
     locHD = hd;
     Application.LoadLevel(2);
 }
开发者ID:polecatqcon,项目名称:TheReturn,代码行数:11,代码来源:NetworkManager.cs


示例16: ConnectToServer

 public static void ConnectToServer(HostData server)
 {
     if (server != null)
     {
         Network.Connect(server);
     }
     else
     {
         Debug.LogError("Missing Host Data");
     }
 }
开发者ID:Bananenkiste,项目名称:CardGameCreator,代码行数:11,代码来源:NetworkManager.cs


示例17: connectionRow

 //Shows a single row of valid server.
 void connectionRow(HostData host)
 {
     GUILayout.BeginHorizontal();
         GUILayout.Label(host.gameName + " (" + host.connectedPlayers + " / " + host.playerLimit + ")");
         GUILayout.Label(host.comment);
         if (GUILayout.Button("Connect", GUILayout.MaxWidth(Screen.width/10)))
         {
             Network.Connect(host);	//Uses unitys server connection protocal
         }
     GUILayout.EndHorizontal();
 }
开发者ID:tavoe,项目名称:blocker,代码行数:12,代码来源:ConnectionManager.cs


示例18: ConnectToServer

 void ConnectToServer(HostData server, string password)
 {
     last_tried_server_ = server;
     game_name_ = server.gameName;
     SetState(State.JOINING);
     NetworkConnectionError err = Network.Connect(server, password);
     if(err != NetworkConnectionError.NoError){
         display_err_ = ""+err;
         SetState(State.JOIN_FAIL);
     }
 }
开发者ID:jminor,项目名称:FTJ,代码行数:11,代码来源:NetUIScript.cs


示例19: ConnectTo

 void ConnectTo(HostData hostData)
 {
     // Set NAT functionality based on the host information
     //		Network.useNat = hostData.useNat;
     //		if (Network.useNat)
     //			log.Add("Using Nat punchthrough to connect to host");
     //		else
     //			log.Add("Connecting directly to host: " + string.Join(" ", hostData.ip));
     Network.Connect(hostData.ip, hostData.port);
     Application.LoadLevel(Networking.STARTING_LEVEL);
 }
开发者ID:LoganBarnett,项目名称:Droids,代码行数:11,代码来源:ClientConnector.cs


示例20: ConnectWithServer

    /*
     * @brief		Connects to a specified server
     * @param
     * @return	void
     */
    public void ConnectWithServer(HostData hostToConnect)
    {
        if(hostToConnect != null) {

            Network.Connect(hostToConnect);
        }
        else {

            Network.Connect(connectToIP, networkConnectPort);
        }
    }
开发者ID:ernesthelsing,项目名称:Trabalho-Alexandre-Fernando,代码行数:16,代码来源:NetworkGame.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.Keyframe类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.Gradient类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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