Exemplo n.º 1
0
    public void MoveTo(Vector3Int destination)
    {
        // prevents the dialog box to display all possible buildings the first time it is enabled
        if (btnListControlInitialized == false)
        {
            EnvironmentTile tile;
            GameTiles.instance.environmentTiles.TryGetValue(destination, out tile);
            btnListControl.Initialize(tile);

            btnListControlInitialized = true;
        }

        // Offset dialog box so that its top left corner is in the middle of the clicked tile
        Vector3 adjustedDestination = new Vector3(destination.x + 0.5f, destination.y + 0.5f, transform.position.z);

        transform.position = adjustedDestination;
    }