Ejemplo n.º 1
0
    public void MoveToTile(Vector3Int targetTile)
    {
        if (movable)
        {
            WorldTile targetWorldTile = manager.worldTiles[targetTile];

            if (currentWorldTile != null)
            {
                currentWorldTile.SetUnit(null);
            }
            currentWorldTile   = targetWorldTile;
            transform.position = targetWorldTile.worldPosition;
            targetWorldTile.SetUnit(this);

            movable = false;
        }
    }