Beispiel #1
0
        public static int TILE_SIZE = 44; //格子高度

        #endregion Fields

        #region Methods

        public static Pt flatToIsoWithPt(float px, float py, Pt pt = null)
        {
            pt.x = py + px * .5;
            pt.y = 0;
            pt.z = py - px * .5;
            return pt;
        }
Beispiel #2
0
 public static Pt getIndexWithPt(float x,float z, Pt pt,float defaultTileSize=0)
 {
     defaultTileSize = defaultTileSize == 0 ? TILE_SIZE : defaultTileSize;
     defaultTileSize = getMeterByPixel(defaultTileSize);
     pt = flatToIsoWithPt(x, z, pt);
     pt.x = Math.Floor(pt.x / defaultTileSize);
     pt.y = Math.Floor(pt.y / defaultTileSize);
     pt.z = Math.Floor(pt.z / defaultTileSize);
     return pt;
 }
Beispiel #3
0
 /**
  * 将p_map_tile路径转为Pt路径
  * @param arr
  * @return
  *
  */
 public static Pt[] walkPath_pt(object[] arr)
 {
     Pt[] ptArr = new Pt[arr.Length];
     for (int i = 0; i < arr.Length; i++) {
         int tx = PosUtil.getTx((int)arr[i]);
         int ty = PosUtil.getTy((int)arr[i]);
         int tz = PosUtil.getTz((int)arr[i]);
         Pt pt = new Pt(tx, ty, tz);
         ptArr[i] = pt;
     }
     return ptArr;
 }
Beispiel #4
0
 public void toFight(int sid = 1,double targetID = 0, int targetType = 0, Pt pt = null)
 {
     m_fight_attack_tos vo = new m_fight_attack_tos();
     vo.auto_hook = 0;
     vo.skillid = sid;
     vo.dir = UnitPool.getMyRole().curDir;
     vo.target_id = targetID;
     vo.target_type = targetType;
     if (targetID != 0) {
         SceneUnit unit = SceneUnitMgr.getUnit(targetID);
         vo.target_pos = unit.pos;
     }
     sendSocketMessage(vo);
 }