/// <summary> /// 시작위치에서 끝위치까지가 어떤 방향인지 반환 /// </summary>ㄴ /// <param name="startPos">시작 월드 포지션</param> /// <param name="endPos">끝 월드 포지션</param> /// <returns>방향</returns> public static Direction GetDirection(Vector3 startPos, Vector3 endPos) { float degree = Vector3Ex.GetDirectionDegree(startPos, endPos); if (degree <= 60f) { return(Direction.RightUp); } if (degree <= 120f) { return(Direction.Up); } if (degree <= 180f) { return(Direction.LeftUp); } if (degree <= 240f) { return(Direction.LeftDown); } if (degree <= 300f) { return(Direction.Down); } return(Direction.RightDown); }