MyClient.Start C# (CSharp) Method

Start() private method

private Start ( ) : void
return void
    void Start()
    {
        //on client, this isn't required but is nice for testing.
        Application.runInBackground = true;

        var globals = FindObjectOfType<GlobalAssets>();

        _networkStateEntityProtoType = globals.NetworkEntityStatePrototype.GetComponent<NetworkIdentity>();

        ClientScene.RegisterSpawnHandler(_networkStateEntityProtoType.assetId, OnSpawnEntity, OnDespawnEntity);

        _client = new NetworkClient();
        _client.Connect("localhost", 7777);
        _client.RegisterHandler(MsgType.Connect, OnClientConnected);

    }

Usage Example

Esempio n. 1
0
        public async Task SendMessage()
        {
            //1 client1 locked patient1.
            await _myClient.Start();

            //2 patient1 is locked.
            await _myClient.Send("test");

            _myClient.clientClients = Clients;
        }
All Usage Examples Of MyClient::Start