當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。