# Sprite Editor

Edits Unity sprite rectangles, borders, pivots, outlines, and slicing by generating C#...

- Repository: https://github.com/Unity-Technologies/skills (1197 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Unity-Technologies/skills --skill sprite-editor -g -a claude-code -y`
Codex: `npx skills add Unity-Technologies/skills --skill sprite-editor -g -a codex -y`
Cursor: `npx skills add Unity-Technologies/skills --skill sprite-editor -g -a cursor -y`
Gemini CLI: `npx skills add Unity-Technologies/skills --skill sprite-editor -g -a gemini-cli -y`

## Description

Edits Unity sprite rectangles, borders, pivots, outlines, and slicing by generating C# scripts. Use when the user works with sprite sheets or sprite slicing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Sprite Editor

Sprite metadata (rects, borders, pivots, outlines) lives inside the importer, not in a file
you can edit, reaching it means running C# through a live Editor.

**The `unity-cli` skill owns getting you there**, installing the CLI, confirming a connected
Editor, adding the project's `com.unity.pipeline` package, telling a genuinely absent Editor
apart from one stuck in Safe Mode, and discovering the Editor's command catalog. Follow it
first; don't re-derive any of it here.

Two things it can't know for you:

- **You need `script eval` in particular**, not just a reachable Editor. Confirm it appears in the
  catalog, its presence depends on the Pipeline package version, not on the CLI.
- **Never hand-edit a `.meta` file to change sprite metadata.** The importer owns that data
  and the capability checks below exist to prevent corruption, so an unreachable Editor is a
  stop, not a cue to improvise.

Run C# through the connected Editor with the `script eval` command. Discover its parameter shape
from `unity command --format json` rather than assuming one, the inline form is
`unity command script eval --code '<snippet>'`, and some Pipeline versions also register
`script eval_file` for running a snippet from a file. **Check the catalog before reaching for
`script eval_file`; it is frequently absent.** `unity command` defaults to a 30 second timeout.

Generates C# editor scripts to manipulate Unity sprites using ISpriteEditorDataProvider. Works with TextureImporter, PSBImporter, and custom importers.

### Passing C# to `script eval`

`script eval` compiles a **statement block, not a file**. Two consequences, both of which cause a
compile error rather than a warning:

The rest: https://github.com/Unity-Technologies/skills/blob/HEAD/skills/sprite-editor/SKILL.md
