Exemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            if (ConnectFlag == false)
            {
                return;
            }
            if (ObjectTransformFlag != -1)
            {
                objectlist[ObjectTransformFlag].transform.localPosition = objecttransformlist[ObjectTransformFlag].Position;
                objectlist[ObjectTransformFlag].transform.localRotation = objecttransformlist[ObjectTransformFlag].Rotation;
                objectlist[ObjectTransformFlag].transform.localScale    = objecttransformlist[ObjectTransformFlag].Scale;
                ObjectTransformFlag = -1;
            }
            for (int i = 0; i < objectlist.Count; i++)
            {
                if (objectlist[i].transform.localPosition != objecttransformlist[i].Position || objectlist[i].transform.localRotation != objecttransformlist[i].Rotation || objectlist[i].transform.localScale != objecttransformlist[i].Scale)
                {
                    client.SendMessage(SetTransformByteList(i, objectlist[i].transform.localPosition, objectlist[i].transform.localRotation, objectlist[i].transform.localScale));
                    objecttransformlist[i].Position = objectlist[i].transform.localPosition;
                    objecttransformlist[i].Rotation = objectlist[i].transform.localRotation;
                    objecttransformlist[i].Scale    = objectlist[i].transform.localScale;
                }
            }
            if (ConnectedFlag)
            {
                for (int i = 0; i < objectlist.Count; i++)
                {
                    TcpNetworkServerManager.Instance.SendMessage(SetTransformByteList(i, objectlist[i].transform.localPosition, objectlist[i].transform.localRotation, objectlist[i].transform.localScale));
                }
                ConnectedFlag = false;
            }

            udpclient.UDPSendMessage(ServerIP);
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            String IP = Properties.Settings.Default.hosts.Substring(0, Math.Max(Properties.Settings.Default.hosts.IndexOf(':'), 0));

            tcpNetworkClientManager.SendMessage(IP);
        }