List <Sprite> GetSpritesOnTileUnderMouse() { Vector3Int tilePositionUnderMouse = tilemapInfo.GetTilePositionUnderMouse(); if (!tilemapInfo.ExistsTileAt(tilePositionUnderMouse)) { return(null); } return(tilemapInfo.GetSpritesAtTilePosition(tilePositionUnderMouse)); }
public void MoveToTilePositionUnderMouse() { Vector3Int tilePositionUnderMouse = tilemapInfo.GetTilePositionUnderMouse(); if (!tilemapInfo.ExistsTileAt(tilePositionUnderMouse)) { return; } bool hasSpritesAtTilePosition = tilemapInfo.GetSpritesAtTilePosition(tilePositionUnderMouse).Count > 0; if (hasSpritesAtTilePosition) { return; } MoveToTilePosition(tilePositionUnderMouse); }