예제 #1
0
        private void OnRecvPlayerFlash(IChannel channel, Message message)
        {
            Console.WriteLine(string.Format("send to backend start"));
            CPlayerFlash request = message as CPlayerFlash;
            Player       player  = (Player)World.Instance.GetEntity(request.player);

            player.Position = Entity.V3ToPoint3d(request.pos);
            SPlayerFlash response = new SPlayerFlash();

            response.ID  = request.player;
            response.pos = request.pos;
            response.rot = request.rot;

            //channel.Send(response);
            //player.Broadcast(response, true);
            World.Instance.Broundcast(response);
            Console.WriteLine(string.Format("send to backend sucess"));
        }
예제 #2
0
        public void SendFlash(int x_, int y_, int z_)
        {
            CPlayerFlash action = new CPlayerFlash();

            action.player = m_entity.entityId;
            action.rot.x  = transform.rotation.x;
            action.rot.y  = transform.rotation.y;
            action.rot.z  = transform.rotation.z;
            action.rot.w  = transform.rotation.w;
            action.pos.x  = x_;
            action.pos.y  = y_;
            action.pos.z  = z_;
            //action.pos = new Vector3(1, 2, 3);//!!!!!!!!!!!!
            Debug.Log("======================");
            print(action.player);
            Debug.Log("======================");
            MyNetwork.Send(action);
            //Client.Instance.Send(action);
            Debug.Log("success use flashfuction in step 1");
        }