当前位置: 首页>>代码示例>>C#>>正文


C# UnityEngine.HostData类代码示例

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


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


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