unity-technologies/skills

sprite-editor

Edits Unity sprite properties by generating C editor scripts using ISpriteEditorDataProvider APIs.

소스 보기
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

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 `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 eval command. Discover its parameter shape from unity command --format json rather than assuming one — the inline form is unity command eval --code '<snippet>', and some Pipeline versions also register eval_file for running a snippet from a file. Check the catalog before reaching for `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 eval

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

  • No `using` directives. The compiler reads using UnityEngine; as a resource-disposal

statement and rejects it (CS0210).

  • Types must be fully qualified. A bare AssetDatabase or Volume does not resolve

(CS0246 / CS0103), and a bare Object is ambiguous with object (CS0104).

Where a snippet below is written as a file — with usings, for readability, or because it is meant to be saved into the project — qualify the types before passing it to eval.

Workflow

All generated scripts must follow the Safe Core Pattern in references/templates.md, which includes MANDATORY capability checks. NEVER attempt operations if capability checks fail - this prevents data corruption. After execution, verify results in Unity console and Project window.

Common Operations

Modify Name/Rect/Border/Pivot: Update corresponding SpriteRect fields (see scripts/SetPivotExample.cs for pivot examples)

  • Requires: EditSpriteName, EditSpriteRect, EditBorder, or EditPivot

Add/Remove/Slice: Create or filter SpriteRect array (see references/background.md for Unity 2021.2+ requirements)

  • Requires: CreateAndDeleteSprite

Set Outlines: Get ISpriteOutlineDataProvider → Call SetOutlines() with GUID + Vector2 arrays

Important Notes

  • Do NOT use AssetPostprocessor or MenuItem patterns
  • Generate standalone snippets only — no AssetPostprocessor, no MenuItem
  • Enum assignments: Always use enum values and cast to numeric types. Never use raw numbers.
  • ✅ Correct: (int)SpriteAlignment.Center
  • ❌ Wrong: 1 (magic number)
같은 저장소의 Skills

더 많은 Skills

모든 Skills
unity-technologies
커뮤니티

build-live-game

Build and operate a live game using Unity Services. Use when the user needs to implement, connect, or debug backend-driven features — battle passes, achievements, player progression, cloud saves, leaderboards, matchmaking, virtual economies, server-authoritative logic, anti-cheat, player accounts and authentication, remote configuration, feature flags, A/B testing, analytics, or cloud resource deployment. Triggers on live-ops, live service, backend, server authority, cloud code, cloud save, remote config, player data, retention, monetization loop, season pass, ranking, multiplayer sessions, lobbies, or any Unity Services integration.

설치 수
1
GitHub Stars
730
업데이트
9월 4일
unity-technologies
커뮤니티

implement-in-app-purchases

Implement, configure, and debug Unity In-App Purchases (IAP) — store connection, product catalog, consumable/non-consumable/subscription purchases, two-step pending-confirm flow, receipt validation, entitlement checking, restore transactions, Apple extensions (promotional purchases, Ask-to-Buy, code redemption), and Google Play extensions (subscription upgrade/downgrade), D2C Capabilities(direct to customer), 3rd party payment provider (Stripe/Coda) via Unity IAP/Unity Cloud. Use when the user needs to add, modify, debug, or migrate from native Android/iOS billing, 3rd party packages(RevenueCat/Adapty/Essential Kit/Unipay supported) to IAP. Triggers on microtransactions (MTX), monetization, real-money purchases, store purchases, buying items, support D2C, purchase via Stripe/Coda, migrate from native billing(Google's BillingClient or Apple's StoreKit/SKPaymentQueue/SKProduct)/RevenueCat/Adapty/EssentialKit/Unipay.

설치 수
1
GitHub Stars
730
업데이트
9월 4일
unity-technologies
커뮤니티

initialize-ai-navigation

Sets up and configures the Unity AI Navigation system — NavMesh surfaces, NavMesh agents, obstacles, links, modifiers, areas and costs. Use when creating walkable navigation meshes, adding pathfinding agents, setting up patrol routes, configuring obstacle avoidance and carving, connecting separate NavMeshes with links, coupling navigation with animation, or troubleshooting navigation issues.

설치 수
1
GitHub Stars
730
업데이트
9월 4일
unity-technologies
커뮤니티

levelplay-unity-integration

Adds ads and monetization to a Unity game using the LevelPlay Mediation SDK (installed via the Ads Mediation UPM package). Use when a developer asks about adding ads to a Unity game, implementing rewarded, interstitial, or banner ads, setting up ad mediation, configuring ad networks, installing or updating the Ads Mediation package, troubleshooting LevelPlay namespace errors, resolving Android gradle or iOS CocoaPods dependency issues for ads, configuring ATT or privacy settings for ad compliance, tracking impression-level revenue (ILRD), initializing the LevelPlay SDK, or setting up ad unit IDs. Also use when a developer wants to monetize their Unity game with ads, asks how to get started with LevelPlay, ads, or mediation, or needs help with any part of the LevelPlay integration workflow including platform-specific setup for iOS or Android. Also use when upgrading the LevelPlay or IronSource SDK version, migrating from deprecated IronSource.Agent APIs, or migrating a game from Unity Ads to LevelPlay.

설치 수
1
GitHub Stars
730
업데이트
9월 4일