UnityEngine.Networking.NetworkManager.StartClient C# (CSharp) Method

StartClient() public method

This starts a network client. It uses the networkAddress and networkPort properties as the address to connect to.

public StartClient ( ) : NetworkClient
return NetworkClient
        public NetworkClient StartClient()
        {
            return this.StartClient(null, null);
        }

Same methods

NetworkManager::StartClient ( MatchInfo matchInfo ) : NetworkClient
NetworkManager::StartClient ( MatchInfo info, ConnectionConfig config ) : NetworkClient

Usage Example

コード例 #1
0
        void Update()
        {
            if (!showGUI)
            {
                return;
            }

            if (!NetworkClient.active && !NetworkServer.active && manager.matchMaker == null)
            {
                if (Input.GetKeyDown(KeyCode.S))
                {
                    manager.StartServer();
                }
                if (Input.GetKeyDown(KeyCode.H))
                {
                    manager.StartHost();
                }
                if (Input.GetKeyDown(KeyCode.C))
                {
                    manager.StartClient();
                }
            }

            /*
             * if (NetworkServer.active && NetworkClient.active)
             * {
             *      if (Input.GetKeyDown(KeyCode.X))
             *      {
             *              manager.StopHost();
             *      }
             * }
             */
        }
All Usage Examples Of UnityEngine.Networking.NetworkManager::StartClient