public virtual void StartAction(InGameBaseObj target, Vector3 targetPos, int dis) { astarDis = dis; Vector3 _targetMapPos = GameCommon.GetMapPos(targetPos); if (_targetMapPos == targetMapPos) { return; } Vector2 startPos = GameCommon.GetMapPos(parent.transform.position); MazeMapManager gameMap = InGameManager.GetInstance().inGameLevelManager.gameMap; List <Vector2> _path = astar.StratAStar( gameMap.astarArray, startPos, GameCommon.GetMapPos(targetPos), dis); if (_path.Count <= 0) { return; } HandlePath(startPos, _path); path = _path; isaction = true; this.target = target; this.targetPos = targetPos; targetMapPos = _targetMapPos; atkTime = 0; state = ActionState.move; }
public override void Init() { gameModel = BaseGameModelManager.GetGameMode(BaseGameModelManager.GameLevelModel.level); gameModel.Init(); if (GameGlobal.selLevelConfId == -1) { gameMap = MazeMapManager.CreateMapManager(ConfigManager.mapConfManager.dataMap[1]); } else { gameMap = MazeMapManager.CreateMapManager(ConfigManager.mapConfManager.dataMap[GameGlobal.selLevelConfId]); } //gameMap = MazeMapManager.CreateMapManager(MazeMapManager.MapType.en_type_randomgroup,4,2,2); //gameMap = MazeMapManager.CreateMapManager(MazeMapManager.MapType.en_type_fixeditormap, 5004010, 100, 100); }