Exemple #1
0
    private void MoveTo(CellData desiredCell, CellData currentPosition)
    {
        if (desiredCell.IsEmpty())
        {
            Vector3 desiredCellPosition = BoardBehaviour.Get().GetWorldPositionOfCell(desiredCell);
            Vector3 destination         = new Vector3(desiredCellPosition.x, cachedTransform.position.y, desiredCellPosition.z);

            currentPosition.SetEmpty(true);
            desiredCell.SetEmpty(false);

            GameController.Get().StartCoroutine(this.MovingToCell(destination));
        }
        else
        {
            Move(soldierGoal, movementRange);
        }
    }