Beispiel #1
0
        public void GetUnitMove(int unitId, int[] moveTileXy)
        {
            var moveUnit = Unit.GetUnitById(unitId);
            var moveTile = MapTile.GetMapTileFromPos(moveTileXy[0], moveTileXy[1]);
            var rTiles   = MoveRoute.GetMoveRoute(moveUnit.GetCurrentMapTile(), moveTile);

            Unit.GetUnitById(unitId).MoveUnit(rTiles);
        }
Beispiel #2
0
 private static void UpdateMovementUi()
 {
     if (_hoverTile.MoveNum > 0 && !_hoverTile.TileProp)
     {
         var rTiles = MoveRoute.GetMoveRoute(_currentUnit.GetCurrentMapTile(), _hoverTile);
         RouteLine.DrawMoveLine(rTiles);
     }
     else
     {
         RouteLine.DestroyMoveLine();
     }
 }
Beispiel #3
0
        private static void MoveTileSelected(object sender, EventArgs args)
        {
            if (_hoverTile == null || _hoverTile.MoveNum < 1)
            {
                return;
            }
            _currentUnit.moveTaken = true;
            DestroyMovementUI();
            var rTiles = MoveRoute.GetMoveRoute(_currentUnit.GetCurrentMapTile(), _hoverTile);

            _currentUnit.MoveUnit(rTiles);
            GameManager.SendUnitMove(_currentUnit, _hoverTile);
        }