mcpField
T
tilemap-palette-create

tilemap-palette-create

github.com/unity-technologiesCreative & media1.2k2.3k installsUpdated 1d ago
Repository

About tilemap-palette-create

This skill creates Unity Tile Palette assets with UnityEditor.Tilemaps.GridPaletteUtility.CreateNewPalette. It selects cell sizing for rectangular, hexagonal, or isometric grids and specifies a sort axis for isometric palettes.

Key features

  1. 01Create Tile Palette assets
  2. 02Support rectangular, hexagonal, and isometric grids
  3. 03Set cell sizes by grid type
  4. 04Configure a sort axis for isometric grids
  5. 05Ensure a GridPalette sub-asset is present

Use cases

  1. 01Create a rectangular grid palette
  2. 02Set up a hexagonal Tile Palette
  3. 03Configure isometric cell sizing and sorting
  4. 04Check for GridPalette in the created asset

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/unity-technologies/skills --skill tilemap-palette-create

After installing, type/tilemap-palette-createin Claude Code to confirm it loaded.

Bundled filesscripts/CreatePaletteTemplate.cs

Details

From the project README

Tilemap Palette Creation

Workflow

Step 1: Parameter Gathering

WAIT for the user to specify the following parameters if not already provided:

  • Palette Name: The name of the asset.
  • Grid Type: Rectangular, Hexagonal, or Isometric.
  • Cell Size: Optional (defaults based on Grid Type).
  • Sort Axis: Required for Isometric palettes.
Step 2: Asset Creation

Utilise UnityEditor.Tilemaps.GridPaletteUtility.CreateNewPalette to create the Tile Palette asset.

Branching Logic (Grid Types)

Path A: Rectangular
  • Use Automatic cell sizing. Use cell size: (1, 1, 0) as a default.
Path B: Hexagonal
  • Use cell size: (0.8659766, 1, 1).
Path C: Isometric
  • Use cell size: (1, 0.5, 1).
  • Use a Custom Sort Axis with value (0, 0, 1).
Path D: Isometric Z As Y
  • Use cell size: (1, 0.5, 1).
  • Use a Custom Sort Axis with value (0, 0, 1).

Post-Creation

Ensure that there is a GridPalette as a sub-asset of the Tile Palette asset.

References

Code Template: "scripts/CreatePaletteTemplate.cs"

Comments

Markdown supported