コード例 #1
0
ファイル: SceneView.cs プロジェクト: ucjedpfmd/U3DGame
 public void addUnit(SceneUnit unit, double id, int pos, object vo, int dir = 4)
 {
     unit.id = id;
     enterPoint = TileUitls.getFlatCenterByPosWithVertor3(pos, enterPoint);
     if (unit is MyRole) {
         unit.reset();
         //(unit).reset(vo);
         if (unit is MyRole) {
             myRole = unit as MyRole;
             //centerCamera(hero.x, hero.y);
         }
     } else {
         unit.reset();
         unit.play(AvatarUtil.ACT_STAND);
         //unitCache.push([unit, vo, id, 1]);
     }
     unit.setParent(midLayer);
     unit.resetPos(enterPoint);
     SceneUnitMgr.addUnit(unit);
 }
コード例 #2
0
ファイル: FightCase.cs プロジェクト: ucjedpfmd/U3DGame
 //更正发起者位置
 private void updateFightUnitPos(SceneUnit src,m_fight_attack_toc fightVO)
 {
     if (src != null && fightVO.src_pos > 0) { //更正发起者位置
         Vector3 pos = new Vector3();
         pos = TileUitls.getFlatCenterByPosWithVertor3(fightVO.src_pos,pos);
         src.resetPos(pos);
     }
 }