Exemplo n.º 1
0
 public void MoveTo(float posx, float posy, float moveSpeed)
 {
     m_fsm.blackboard.destination = new Vector3(posx, transform.position.y, posy);
     m_fsm.blackboard.moveSpeed   = moveSpeed;
     m_fsm.Transition(UnitFSM.State.ID.Move);
     Debug.LogFormat("{0} MoveTo {1}", gameObject.name, new Vector2(posx, posy));
 }
Exemplo n.º 2
0
        public void MoveTo(Position destination)
        {
            float moveSpeed = GetAttribute(Attribute.Spd) * 0.01f;

            m_fsm.blackboard.moveSpeed   = moveSpeed;
            m_fsm.blackboard.destination = destination;
            m_fsm.Transition(UnitFSM.State.ID.Move);
            MsgMoveTo_S2C msg = new MsgMoveTo_S2C();

            msg.id   = id;
            msg.spd  = GetAttribute(Attribute.Spd);
            msg.posx = destination.x;
            msg.posy = destination.y;
            m_game.Broadcast(msg);
        }