Manage Sprite Atlasのロゴ

Manage Sprite Atlas

組織人気
Unity-Technologies
manage-sprite-atlas

ビルド前のパイプラインを通じてSpriteAtlasアセットを管理します。マスターアトラスとバリアントアトラス、パッキング設定、プラットフォームごとのオーバーライドに対応します。スプライトアトラスの作成や最適化を依頼された場合に使用します。

Add to TypingMind

概要

公開者Unity-Technologies
リポジトリskills
スキル名manage-sprite-atlas
スター
1K
フォーク
61
同梱ファイル
44
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 44個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    Unity-TechnologiesがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Manage Sprite Atlas」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/Unity-Technologies/skills/tree/main/skills/manage-sprite-atlas
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Unity-Technologies/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/manage-sprite-atlas .claude/skills/manage-sprite-atlas
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでManage Sprite Atlasを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にManage Sprite Atlasを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Manage Sprite Atlasは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Unity SpriteAtlas V2

Provides editor-safe procedural knowledge for scripting atlases in Unity projects. V2 enforces strict separation between editor authoring and runtime access.

⚠ Critical V2 Principle: SpriteAtlas is runtime-only. SpriteAtlasAsset is editor-only. Never mix contexts. Always use V2.

🚨 CRITICAL: Required Checks and User Inputs Before Implementation

ALWAYS perform these checks and ask these questions BEFORE generating any code:

Read the shipped resources before writing code (REQUIRED)

This skill ships working C# under resources/, and the atlas code that goes wrong is almost always code written without reading it first. Open the files for the path you are taking, then write.

resources/ holds 38 files in all, covering custom packers, variants, platform settings, and runtime access. Browse the directory when your task is not in the table above rather than inventing an approach. Reaching for the API from memory instead of reading these is the single most common cause of an atlas that imports cleanly and then does nothing at runtime.

0. Check for Existing Scripts (REQUIRED FIRST STEP)

BEFORE generating any code, scan the project for existing SpriteAtlas scripts generated by this skill.

Search for files containing the identifier: // [UNITY-SKILL:SPRITEATLAS]

If existing scripts are found, ALWAYS ask the user with this format:

"I found existing SpriteAtlas scripts in your project:

Prebuild Generator:

  • Assets/Editor/SpriteAtlas/SpriteAtlasPrebuildGenerator.cs

Addressables Builder:

  • Assets/Editor/SpriteAtlas/BuildAddressablesPostprocess.cs

Runtime Loader:

  • Assets/Scripts/SpriteAtlas/SpriteAtlasLateBinding.cs

What would you like to do?"

Then present options:

  • Option A: Update existing scripts (Recommended if requirements changed)

    • Regenerates scripts at existing paths
    • Preserves file locations
    • Updates to latest version
    • ⚠ May overwrite custom modifications
  • Option B: Create new scripts with different names

    • Generates alongside existing scripts
    • Allows multiple atlas configurations
    • Original scripts remain unchanged
    • You'll need to specify new names/paths
  • Option C: Abort (keep existing unchanged)

    • No code generation
    • No changes to project
    • Use this if you want to keep current setup

User Choice Handling:

  • If A chosen: Regenerate at existing paths, increment version to 2.0.1+
  • If B chosen: Ask for new script names (e.g., "SpriteAtlasPrebuild_Custom.cs"), then generate
  • If C chosen: Stop immediately, inform user no changes were made

1. Delivery Mechanism (REQUIRED)

Ask: "How do you want to deliver the sprite atlases?"

Option A: Built-in Data (Immediate Loading)

  • Atlases are included in the build and loaded immediately
  • Set includeInBuild = true
  • Suitable for: Core UI, main gameplay sprites, always-needed assets
  • Pros: Simple, no additional packages, instant access
  • Cons: Increases initial build size, cannot update without new build

Option B: Late-Binding via Addressables (On-Demand Loading)

  • Atlases are NOT included in build, loaded on-demand via Addressables
  • Set includeInBuild = false
  • Create Addressables entries for each atlas
  • Add addressable setup as prebuild step
  • 🚨 REQUIRED: Build Addressables content as build step
  • 🚨 REQUIRED: Create late-binding runtime loader script
  • Suitable for: DLC content, optional features, large assets, downloadable content
  • Pros: Smaller initial build, can update independently, on-demand loading
  • Cons: Requires Addressables package, async loading, network dependency
Use CaseRecommended
Core UI sprites that are always visibleOption A: Built-in
Tutorial or onboarding spritesOption A: Built-in
Level-specific sprites (100+ levels)Option B: Addressables
DLC or seasonal contentOption B: Addressables
Localized UI sprites (multiple languages)Option B: Addressables
Character skins or cosmeticsOption B: Addressables

2. SpritePacker Mode (REQUIRED)

Enable Sprite Packer mode before creating atlases, then read the setting back and confirm it took. Use the code in resources/enablespritepacking.cs; it sets EditorSettings.spritePackerMode and configures the importer's packing settings.

This is the step that decides whether the atlas you produce is real. Disabled is the zero value of SpritePackerMode, so any project where nobody has set it carries packing Disabled, and an atlas created while it is Disabled still imports, still shows up as an asset, and still looks finished, but can never pack. Unity says so in the Inspector: "Sprite Atlas packing is disabled". Nothing else in the workflow fails, so an atlas shipped this way reads as a success. Do not assume a project is already configured: read the value.

So do not treat "I set it" as done. After setting it, read EditorSettings.spritePackerMode back, confirm it is not Disabled, and report the value you actually read. If you cannot read it back, say so rather than assuming the write landed.

DO NOT edit meta files DIRECTLY.

🚨 CRITICAL: Default Approach is Prebuild Generation

ALWAYS use IPreprocessBuildWithReport to automatically generate or update SpriteAtlases during the build pipeline. This is the DEFAULT and REQUIRED approach unless the user EXPLICITLY requests manual authoring.

❌ DO NOT Create Manual Menu Item Scripts

NEVER create scripts with [MenuItem] attributes for atlas generation unless explicitly requested. The prebuild approach eliminates the need for manual clicks. Only use manual authoring for: Hand-optimized layouts, specific sprite arrangements, or editor preview requirements. See Advanced: Manual Authoring.

🚨 CRITICAL: Sprite Source Location Restriction

ONLY add sprites from the project's Assets folder. NEVER add sprites from Unity built-in assets, packages, or external locations. Unity built-in assets cannot be packed into SpriteAtlas, and package assets may cause import/dependency issues.

Critical V2 Architecture

ContextComponentPurposeAllowed Usage
Editor AuthoringSpriteAtlasAssetAdd/remove sprites/folders; store metadata✅ Editor scripts only
Editor SettingsSpriteAtlasImporterConfigure texture, packing, platform settings✅ Editor scripts only
Editor PackingSpriteAtlasUtility.PackAtlases()Optional editor preview packing (not for build)⚠ Only for preview; atlases auto-pack at build
RuntimeSpriteAtlasQuery packed sprites (read-only)✅ Runtime scripts only
Runtime LoadingSpriteAtlasManagerDynamic loading callbacks✅ Runtime scripts only

Forbidden Cross-Context Usage (Common Error Sources)

❌ Invalid Pattern✅ Correct Pattern
new SpriteAtlas() in editor codeUse SpriteAtlasAsset + SpriteAtlasImporter
AssetDatabase.LoadAssetAtPath<SpriteAtlas>(...) in editorUse SpriteAtlasAsset.Load(...)
SpriteAtlasAsset.GetPackables() in editorUse SpriteAtlas.GetPackables()
Modifying SpriteAtlas in editor scriptsModify SpriteAtlasAsset → reimport → use SpriteAtlasImporter
Create variants from original packable objects (sprites/folders)Creating variants from a Master runtime SpriteAtlas

NEVER script against SpriteAtlas in editor code — it is only for runtime use in V2 except for GetPackables.

Core V2 Workflow (Reference Only - Use Prebuild Instead)

🚨 IMPORTANT: This workflow is shown for reference only. ALWAYS implement this inside IPreprocessBuildWithReport.OnPreprocessBuild() rather than in manual scripts. See Quick Start.

Prerequisites

  • Unity 6000.3 or later
  • Basic understanding of Unity's asset import pipeline
  • Familiarity with editor scripting for atlas authoring

Quick Start: Automated Prebuild Generation (DEFAULT APPROACH)

Overview

This is the PRIMARY and DEFAULT way to create SpriteAtlases. Implement IPreprocessBuildWithReport to automatically generate or update SpriteAtlases before each build based on categorization rules. No manual menu clicks required.

Workflow Steps

Step 1: Ask User for Delivery Mechanism

Before generating code, ask: "How do you want to deliver the sprite atlases: (A) Built-in data or (B) Late-binding via Addressables?"

Step 2: Create Prebuild Script

Create this script in an Editor folder. Customize based on user's delivery choice:

Option A: Built-in Data (Immediate Loading)

Built-in Data (Immediate Loading)

Option B: Late-Binding via Addressables (On-Demand Loading)

🚨 CRITICAL ENFORCEMENT: When user chooses Addressables, you MUST generate ALL THREE scripts below. Never generate just one or two - all three are required for Addressables delivery to work.

Required Scripts (ALL THREE MANDATORY):

  1. Prebuild script (IPreprocessBuildWithReport) - Generates atlases, creates Addressables entries
  2. Build Addressables script (IPostprocessBuildWithReport) - Builds Addressables content bundles
  3. Late-binding runtime loader (MonoBehaviour) - Handles on-demand loading at runtime

See references/addressables-delivery.md for complete implementation.

Complete Workflow
User Request
    ↓
Step 0: Check for existing scripts with [UNITY-SKILL:SPRITEATLAS] identifier
    ↓
    ├─ Found existing scripts?
    │   ↓ YES
    │   Ask user: Update existing / Create new / Abort
    │   ↓
    │   Handle user choice
    │
    └─ NO existing scripts or user chose "Create new"
        ↓
        Ask "Built-in data or Addressables?"
        ↓
        ├─ Option A: Built-in
        │   ↓
        │   Generate 1 script: Prebuild generator (includeInBuild=true)
        │
        └─ Option B: Addressables
            ↓
            Generate 3 scripts:
              1. Prebuild: Generate atlases + create Addressables entries (includeInBuild=false)
              2. Postprocess: Build Addressables bundles
              3. Runtime: Late-binding loader component

Step 3: Customize Categorization Rules

Edit the OnPreprocessBuild method to match your project's sprite organization. Choose one or combine multiple strategies:

StrategyWhen to UseImplementation
Folder-basedSprites organized by folder structureGenerateAtlasByFolder("Assets/Art/UI", "Assets/Atlases/UI.spriteatlasv2")
Naming conventionSprites follow naming patternsGenerateAtlasByNaming("Assets/Art", "icon_", "Assets/Atlases/Icons.spriteatlasv2")
Asset labelsSprites tagged with labels
Scene-basedSprites used in specific scenesQuery scene references

Step 4: Build Your Project

Atlases are automatically generated/updated during build. No manual menu clicks required. This is why prebuild is the default approach.

For Built-in Data (Option A):

  • Atlases are included in build
  • Ready for immediate use at runtime

For Addressables (Option B) - Additional Required Steps:

You MUST generate THREE scripts (not just one):

  1. Prebuild script (IPreprocessBuildWithReport) - Generates atlases and creates Addressables entries automatically
  2. Build Addressables script (IPostprocessBuildWithReport) - Builds Addressables content bundles
  3. Late-binding runtime loader (MonoBehaviour) - Handles on-demand loading via SpriteAtlasManager

The build process will:

  • Generate atlases (prebuild step)
  • Create addressable entries automatically
  • Build addressables content bundles (postprocess step)
  • At runtime: Late-binding loader automatically loads atlases when sprites are first accessed

Common Categorization Patterns

By Folder Structure:

csharp
GenerateAtlasByFolder("Assets/Art/UI/Buttons", "Assets/Atlases/UI_Buttons.spriteatlasv2");
GenerateAtlasByFolder("Assets/Art/UI/Icons", "Assets/Atlases/UI_Icons.spriteatlasv2");
GenerateAtlasByFolder("Assets/Art/Characters/Player", "Assets/Atlases/Player.spriteatlasv2");

By Naming Convention:

csharp
GenerateAtlasByNaming("Assets/Art", "icon_", "Assets/Atlases/Icons.spriteatlasv2");
GenerateAtlasByNaming("Assets/Art", "bg_", "Assets/Atlases/Backgrounds.spriteatlasv2");

Variant Generation in Prebuild

Generate variant atlases for different resolutions.

Advanced: Manual Authoring (NOT Default - Use Only When Explicitly Requested)

⚠ WARNING: Manual authoring is NOT the default approach. Only use these patterns when the user EXPLICITLY requests manual control or editor preview during development.

🚨 DEFAULT APPROACH: Use prebuild generation with IPreprocessBuildWithReport instead. See Quick Start.

Manual authoring is appropriate ONLY for:

  • Hand-optimized sprite layouts where exact positioning matters
  • Custom sprite ordering requirements
  • Editor preview during authoring workflow
  • Explicitly requested by user

DO NOT use manual authoring when:

  • User asks to "create sprite atlas" (use prebuild)
  • User asks to "optimize sprites" (use prebuild)
  • User asks for automated workflow (use prebuild)
  • No specific manual control requirement mentioned

For complete manual authoring patterns including master atlas creation, variant creation, and runtime loading, see references/manual-authoring.md.

Key Requirements (V2-Specific)

  1. 🚨 ALWAYS check for existing scripts FIRST: Before generating code, scan for scripts with [UNITY-SKILL:SPRITEATLAS] identifier and prompt user to update or create new
  2. 🚨 ALWAYS tag generated scripts: Include skill identifier at the top of every generated script for future detection
  3. 🚨 ALWAYS ask for delivery mechanism: Ask user "Built-in data or Addressables?" before generating code
  4. 🚨 ALWAYS enable Sprite Packer mode: Set EditorSettings.spritePackerMode = SpritePackerMode.SpriteAtlasV2 in prebuild script
  5. 🚨 ALWAYS use prebuild generation: Implement IPreprocessBuildWithReport as the DEFAULT approach for creating atlases
  6. 🚨 ONLY add sprites from Assets/ folder: Never add sprites from Packages, built-in assets, or external locations
  7. 🚨 For Addressables delivery, ALWAYS generate THREE scripts:
    • Prebuild atlas generator with Addressables setup
    • IPostprocessBuildWithReport to build Addressables content
    • Late-binding runtime loader script (extends SpriteAtlasManager)
  8. Set includeInBuild correctly: true for built-in data, false for Addressables
  9. Two-Step Editor Pattern: Create with SpriteAtlasAsset → Save → Import → Configure via SpriteAtlasImporter → SaveAndReimport()
  10. Never use SpriteAtlas in editor code — except SpriteAtlas.GetPackables() instance method on a loaded runtime atlas
  11. Variants reference master: Use SetMasterAtlas(SpriteAtlas) with runtime instance loaded via AssetDatabase.LoadAssetAtPath<SpriteAtlas>()
  12. Platform format assignment: Use format = TextureImporterFormat.ASTC_6x6 directly (no cast)
  13. File extension: V2 atlases use .spriteatlasv2 (not .spriteatlas)
  14. SpriteAtlasUtility.PackAtlases() is optional: Only for editor preview; build-time packing is automatic

For common errors and invalid patterns, see references/common-errors.md.

Detailed Reference

Namespaces

Editor Scripts:

csharp
using UnityEditor;            // AssetImporter, AssetDatabase
using UnityEditor.U2D;        // SpriteAtlasAsset, SpriteAtlasImporter, SpriteAtlasUtility
using UnityEngine;            // Runtime types (e.g., TextureImporterFormat)
using UnityEngine.U2D;        // SpriteAtlas

Runtime Scripts:

csharp
using UnityEngine;            // Core Unity types
using UnityEngine.U2D;        // SpriteAtlas, SpriteAtlasManager

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Manage Sprite Atlas」では何ができますか?

ビルド前のパイプラインを通じてSpriteAtlasアセットを管理します。マスターアトラスとバリアントアトラス、パッキング設定、プラットフォームごとのオーバーライドに対応します。スプライトアトラスの作成や最適化を依頼された場合に使用します。

TypingMindでManage Sprite Atlasを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Manage Sprite Atlasはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにManage Sprite Atlasをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Unity-Technologies/skills/tree/main/skills/manage-sprite-atlasを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Manage Sprite Atlasを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Manage Sprite Atlasで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもManage Sprite Atlasを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Manage Sprite Atlas」は無料ですか?

Unity-TechnologiesがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇