Esempio n. 1
0
 /// <summary>
 /// 根据实际坐标获取相对于该坐标的方向
 /// </summary>
 /// <param name="realX"></param>
 /// <param name="realY"></param>
 /// <returns></returns>
 public ActionDirection GetDirectionByRealPos(int realX, int realY)
 {
     return(ActionDirectionUtil.GetDirection8(this.realX, this.realY, realX, realY));
 }
Esempio n. 2
0
        /// <summary>
        /// 根据方向获取指定距离的坐标点
        /// </summary>
        /// <param name="direction"></param>
        /// <param name="dist"></param>
        /// <returns></returns>
        public MapPos GetPosByDirection(ActionDirection direction, int dist = 1)
        {
            Vector3 vector = ActionDirectionUtil.GetVectorByDirection(direction);

            return(new MapPos(x + (int)vector.x * dist, y + (int)vector.y * dist));
        }
Esempio n. 3
0
 /// <summary>
 /// 根据坐标获取相对于该坐标的方向
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public ActionDirection GetDirectionByMapPos(int x, int y)
 {
     return(ActionDirectionUtil.GetDirection8(this.x, this.y, x, y));
 }