Exemple #1
0
    private void ConnectCallBack()
    {
        int     id       = ControllerManager.Ins.ownId;
        Vector3 startPos = ControllerManager.Ins.players[id].startPos;

        isNetConnected = true;
        string msg = MessageCode.create + "," + startPos.x + "," + startPos.y + "," + startPos.z + "@" + id;

        netMangaer.SendMsg(msg);
    }
Exemple #2
0
    void Update()
    {
        if (Input.GetKey(KeyCode.C))
        {
            netMangaer.ConnectServer();
        }

        if (Input.GetKey(KeyCode.Space))
        {
            netMangaer.SendMsg("this is unity client");
        }

        if (msgQueue != null && msgQueue.Count > 0)
        {
            string str = msgQueue.Dequeue();
            text.text += str + "\n";
        }
    }