Exemplo n.º 1
0
        protected override void OnClick()
        {
            HexCell cell = ClickCell();

            if (cell == null ||
                (cell.State != HexCellState.Move && cell.State != HexCellState.MovePath) ||
                cell == owner.CurrentUnit.cell
                )
            {
                moveTarget = null;
                SeleCell   = null;
                if (path != null)
                {
                    HexGrid.Instantiate.ChangeCellState(path, HexCellState.Move);
                }
                path.Clear();
                BattlePanel.Instance.downMenu.UpdateAp(owner.CurrentUnit, 0);
                Extend.ClosePrompt();
                return;
            }
            if (SeleCell == null || SeleCell != cell)
            {
                SeleCell = cell;
                Extend.UpdatePrompt("再次点击确定移动目标");
                moveTarget = range.Find(a => a.cell == cell);
                if (path != null)
                {
                    HexGrid.Instantiate.ChangeCellState(path, HexCellState.Move);
                }
                path = new List <NavCell>();
                NavCell nav = moveTarget.Copy();
                while (nav != null)
                {
                    path.Insert(0, nav);
                    nav = nav.parent;
                }
                HexGrid.Instantiate.ChangeCellState(path, HexCellState.MovePath);
                BattlePanel.Instance.downMenu.UpdateAp(owner.CurrentUnit, moveTarget.consume);
                return;
            }
            owner.ChangeState <MoveBattleState>(moveTarget);
        }
Exemplo n.º 2
0
 public virtual void Exit( )
 {
     Extend.ClosePrompt();
     RemoveListeners();
 }