Esempio n. 1
0
    List <Sprite> GetSpritesOnTileUnderMouse()
    {
        Vector3Int tilePositionUnderMouse = tilemapInfo.GetTilePositionUnderMouse();

        if (!tilemapInfo.ExistsTileAt(tilePositionUnderMouse))
        {
            return(null);
        }
        return(tilemapInfo.GetSpritesAtTilePosition(tilePositionUnderMouse));
    }
Esempio n. 2
0
    public void MoveToTilePositionUnderMouse()
    {
        Vector3Int tilePositionUnderMouse = tilemapInfo.GetTilePositionUnderMouse();

        if (!tilemapInfo.ExistsTileAt(tilePositionUnderMouse))
        {
            return;
        }

        bool hasSpritesAtTilePosition = tilemapInfo.GetSpritesAtTilePosition(tilePositionUnderMouse).Count > 0;

        if (hasSpritesAtTilePosition)
        {
            return;
        }
        MoveToTilePosition(tilePositionUnderMouse);
    }