Tilemap Ruletile Createfromsegmentのロゴ

Tilemap Ruletile Createfromsegment

組織人気
Unity-Technologies
tilemap-ruletile-createfromsegment

既存の地形またはエッジのスプライトからRuleTileを作成し、ペイント中にタイルが自動で接続されるようにします。また、sprite-segment-3x3gridの出力パターンをTilingRulesに変換します。スプライトを正しく接続させたい場合や、タイルの隣接ルールを定義したい場合に使います。入力としてスプライトが提供されている必要があります。

Add to TypingMind

概要

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

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

  • どのLLMでも利用可能

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

  • 3個の同梱ファイル

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

  • オープンソース

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

インストール

AIスキル「Tilemap Ruletile Createfromsegment」を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/tilemap-ruletile-createfromsegment
  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/tilemap-ruletile-createfromsegment .claude/skills/tilemap-ruletile-createfromsegment
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Tilemap RuleTile Create From Segment

Purpose

This skill creates Unity RuleTile TilingRules by first analyzing sprites using the sprite-segment-3x3grid skill, then converting the resulting text patterns into neighbor rule configurations. The user must specify Sprites or a Spritesheet input.

Workflow

Step 1: sprite-segment-3x3grid    Step 2: Create TilingRules
+--------------------------+      +--------------------------+
|  Analyze each Sprite     |      |  Parse text patterns     |
|  using color matching    |  ->  |  Map to neighbor rules   |
|  Output: text pattern    |      |  Sort by specificity     |
+--------------------------+      +--------------------------+

CRITICAL: Always run the sprite-segment-3x3grid skill first on each Sprite to generate the text pattern.

Step 1: Apply sprite-segment-3x3grid (Required)

For each Sprite in your texture, analyze it with sprite-segment-3x3grid:

csharp
string pattern = SpriteSegment3x3Grid.AnalyzeSpriteGrid(sprite, matchThreshold: 0.75f);

Pattern Output Format

Single-line text pattern: [TopRow] / [MiddleRow] / [BottomRow]

Each row contains 3 characters separated by spaces:

  • X - Cell does NOT meet match threshold
  • . - Cell MEETS match threshold (matches center color)
  • * - Center cell (the tile itself)

Example: X X X / X * X / . . .

Step 2: Create TilingRules from Patterns

Symbol to Rule Mapping

SymbolRuleTile NeighborValueBehavior
.This1Neighbor must be an instance of this RuleTile
XDontCare0Position not added to neighbors list
*(center)N/AIgnored - represents the tile itself

Note: "DontCare" is not an explicit constant. A position is "don't care" when it is simply not included in the m_Neighbors and m_NeighborPositions lists.

Neighbor Position Mapping

Grid Layout:              Unity Vector3Int positions:
[0] [1] [2]  (Top)        (-1,1,0)  (0,1,0)  (1,1,0)
[3] [*] [5]  (Middle)     (-1,0,0)    ---    (1,0,0)
[6] [7] [8]  (Bottom)     (-1,-1,0) (0,-1,0) (1,-1,0)
IndexPositionVector3Int
0Top-Left(-1, 1, 0)
1Top(0, 1, 0)
2Top-Right(1, 1, 0)
3Left(-1, 0, 0)
4Center(skipped)
5Right(1, 0, 0)
6Bottom-Left(-1, -1, 0)
7Bottom(0, -1, 0)
8Bottom-Right(1, -1, 0)

Pattern Filtering

By default, detected patterns that do not match any entry in the Common Tile Patterns table are discarded. Only the 47 known patterns are kept. This prevents unexpected or noisy rules from appearing in the final RuleTile.

If the user explicitly asks to keep non-standard patterns, set filterToKnownPatterns: false to bypass this filtering.

Deduplication

Duplicate TilingRules with identical neighbor configurations are automatically removed. When multiple sprites produce the same pattern, only the first sprite encountered is kept.

Rule Sorting

Rules are sorted by specificity (number of This rules) in descending order. More specific rules are evaluated first.

This CountExample PatternPriority
8. . . / . * . / . . .First
5. . . / . * . / X X X...
3X X X / X * X / . . ....
0X X X / X * X / X X XLast

Sprite Assignment

Each TilingRule is assigned at most 1 Sprite:

  • Set m_Output to TilingRuleOutput.OutputSprite.Single
  • Assign the sprite to m_Sprites[0]

The RuleTile's m_DefaultSprite is set to the sprite from the bottom-most (least specific) rule. Since rules are sorted by specificity descending, this is the last rule in the list. This sprite is used when no TilingRule matches.

Algorithm Summary

  1. For each Sprite: Run sprite-segment-3x3grid and store the pattern
  2. Filter: Discard patterns not in Common Tile Patterns (unless user opts out)
  3. Deduplicate: Remove duplicate patterns (first sprite wins)
  4. Parse: Split by / for rows, then by space for cells
  5. Extract Neighbors: . -> add position with This (1); X -> skip
  6. Create TilingRule: Populate m_Neighbors and m_NeighborPositions
  7. Assign Sprite: Set single sprite output
  8. Sort: Order by specificity descending
  9. Apply: Add sorted rules to RuleTile asset
  10. Default Sprite: Set m_DefaultSprite to the last (least specific) rule's sprite

Scripts

Implementation and usage examples are in the scripts/ folder:

FileDescription
TilemapRuleTileCreateFromSegment.csCore implementation with CreateRuleTileFromSprites, CreateTilingRuleFromPattern, ParsePattern, and ApplyRulesToTile
RuleTileGenerator.csEditor window example (Tools > Generate RuleTile from Sprites)
ManualWorkflowExample.csManual two-step workflow for finer control over analysis

Quick Usage

csharp
// Get sprites and create rules in one call
var rules = TilemapRuleTileCreateFromSegment.CreateRuleTileFromSprites(
    sprites, matchThreshold: 0.75f, colorTolerance: 0.04f);

// Apply to RuleTile
var ruleTile = ScriptableObject.CreateInstance<RuleTile>();
TilemapRuleTileCreateFromSegment.ApplyRulesToTile(ruleTile, rules);

Common Tile Patterns

Tile TypePatternThis Count
Fully surrounded (inner tile). . . / . * . / . . .8
Top left corner missingX . . / . * . / . . .7
Top right corner missing. . X / . * . / . . .7
Bottom left corner missing. . . / . * . / X . .7
Bottom right corner missing. . . / . * . / . . X7
Top corners missingX . X / . * . / . . .6
Bottom corners missing. . . / . * . / X . X6
Left corners missingX . . / . * . / X . .6
Right corners missing. . X / . * . / . . X6
Top Left and Bottom Right diagonal corners missingX . . / . * . / . . X6
Top Right and Bottom Left diagonal corners missing. . X / . * . / X . .6
Top Left, Top Right and Bottom Left corners missingX . X / . * . / X . .5
Top Left, Top Right and Bottom Right corners missingX . X / . * . / . . X5
Top Left, Bottom Left and Bottom Right corners missingX . . / . * . / X . X5
Top Right, Bottom Left and Bottom Right corners missing. . X / . * . / X . X5
Cross SectionX . X / . * . / X . X4
Flat edge (Bottom)X X X / . * . / . . .5
Flat edge (Top). . . / . * . / X X X5
Flat edge (Left). . X / . * X / . . X5
Flat edge (Right)X . . / X * . / X . .5
L-Shape, Point RightX X X / . * . / . . X4
L-Shape, Point Bottom. . X / . * X / X . X3
L-Shape, Point LeftX . . / . * . / X X X4
L-Shape, Point TopX . X / X * . / X . .3
L-Shape Inverse, Point LeftX X X / . * . / X . .4
L-Shape Inverse, Point BottomX . . / X * . / X . X3
L-Shape Inverse, Point Right. . X / . * . / X X X4
L-Shape Inverse, Point TopX . X / . * . / . . X5
T-Shape, face downX X X / . * . / X . X3
T-Shape, face topX . X / . * . / X X X3
T-Shape, face leftX . X / . * X / X . X3
T-Shape, face rightX . X / X * . / X . X3
Horizontal bridgeX X X / . * . / X X X2
Vertical bridgeX . X / X * X / X . X2
Corner piece, Bottom RightX X X / X * . / X . .3
Corner piece, Bottom LeftX X X / . * X / . . X3
Corner piece, Top Left. . X / . * X / X X X3
Corner piece, Top RightX . . / X * . / X X X3
Edge end, Bottom RightX X X / X * . / X . X2
Edge end, Bottom LeftX X X / . * X / X . X2
Edge end, Top LeftX . X / . * X / X X X2
Edge end, Top RightX . X / X * . / X X X2
Single isolated tile, LeftX X X / . * X / X X X1
Single isolated tile, RightX X X / X * . / X X X1
Single isolated tile, TopX . X / X * X / X X X1
Single isolated tile, BottomX X X / X * X / X . X1
CenterX X X / X * X / X X X0

Notes

  • Always run sprite-segment-3x3grid first -- this skill depends on its output
  • Rules are evaluated in order; first matching rule wins
  • A rule with 0 This conditions matches any configuration (use as fallback)
  • The center cell (*) is always ignored in neighbor calculations
  • Unity's RuleTile supports up to 8 neighbors in a standard 3x3 grid
  • For hexagonal or isometric grids, use HexagonalRuleTile or IsometricRuleTile

Prerequisites

  • sprite-segment-3x3grid skill: generates the input patterns. It ships in this same plugin as sprite-segment-3x3grid, so it is always available — invoke it rather than treating it as an unmet dependency.
  • com.unity.2d.tilemap.extras package: Required for RuleTile class

See Also

  • sprite-segment-3x3grid - required prerequisite; generates the input patterns
  • Packages/com.unity.2d.tilemap.extras/Runtime/Tiles/RuleTile/RuleTile.cs for RuleTile implementation
  • Unity Manual: Rule Tile

同梱ファイル

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

よくある質問

AIスキル「Tilemap Ruletile Createfromsegment」では何ができますか?

既存の地形またはエッジのスプライトからRuleTileを作成し、ペイント中にタイルが自動で接続されるようにします。また、sprite-segment-3x3gridの出力パターンをTilingRulesに変換します。スプライトを正しく接続させたい場合や、タイルの隣接ルールを定義したい場合に使います。入力としてスプライトが提供されている必要があります。

TypingMindでTilemap Ruletile Createfromsegmentを使うメリットは何ですか?

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

TypingMindにTilemap Ruletile Createfromsegmentをインストールするにはどうすればよいですか?

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

Tilemap Ruletile Createfromsegmentを使えるAIモデルはどれですか?

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

Tilemap Ruletile Createfromsegmentで使えるAIモデルの数に制限はありますか?

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

AIスキル「Tilemap Ruletile Createfromsegment」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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