unity-version-split

unity-version-split is a skill for Claude Code, Codex from IvanMurzak/Unity-MCP. It costs 59 tokens per session (1,248 once invoked), scanned A, original, Apache-2.0.

A guide for splitting one C# file into separate implementations for Unity 6.5 and older Unity versions.

In plain words
What is it for?
Use it when a file needs version-specific code, such as handling the change from instance IDs to entity IDs.
Why use it?
It helps keep code compiling when Unity changes an API between versions.

Skill for Claude CodeCodex

About the project

Unity-MCP connects AI coding agents to the Unity game engine through MCP, letting them work with the Unity Editor and running games. It is used by game developers to generate code, automate development and testing, debug projects, and add AI-driven behavior to games. The catalogue entries provide skills, instructions, an MCP integration, and settings for operating this workflow.

IvanMurzak/Unity-MCP · 4,079 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ivanmurzak/unity-mcp/unity-version-split
Any agent
npx skills add IvanMurzak/Unity-MCP --skill unity-version-split
Clone the repo
git clone --depth 1 https://github.com/IvanMurzak/Unity-MCP

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unity-version-split

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/unity-version-split.svg)](https://agentmods.dev/skills/ivanmurzak/unity-mcp/unity-version-split)
Your own site
<a href="https://agentmods.dev/skills/ivanmurzak/unity-mcp/unity-version-split"><img src="https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/unity-version-split.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00059 $0.01248
Opus 5 $0.00030 $0.00624
Sonnet 5 $0.00012 $0.00250
Haiku 4.5 $0.00006 $0.00125

Measured yesterday against content hash b52243de0f1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unity-version-split scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Unity-MCP-Plugin/.claude/skills/unity-version-split/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Unity Version Split

Split a C# source file into two variants: one for Unity 6.5+ (UNITY_6000_5_OR_NEWER) and one for older versions (pre-Unity 6.5).

When to Use

Unity 6.5 introduced breaking changes including:

  • EntityId replaces int for instance IDs (GetEntityId() replaces GetInstanceID())
  • EditorUtility.EntityIdToObject(EntityId) replaces EditorUtility.InstanceIDToObject(int)
  • Implicit EntityId <-> int conversions are marked [Obsolete(..., true)] (compile error)

When a file needs different code for these Unity versions, split it into two files following the project convention.

File Naming Convention

File Purpose Preprocessor Guard
FileName.cs Unity 6.5+ (newer version) #if UNITY_6000_5_OR_NEWER
FileName.pre-Unity.6.5.cs Pre-Unity 6.5 (older version) #if !UNITY_6000_5_OR_NEWER

For files that also have Editor/Runtime variants, combine the guards:

File Guard
FileName.Editor.cs #if UNITY_EDITOR && UNITY_6000_5_OR_NEWER
FileName.Editor.pre-Unity.6.5.cs #if UNITY_EDITOR && !UNITY_6000_5_OR_NEWER
FileName.Runtime.cs #if !UNITY_EDITOR && UNITY_6000_5_OR_NEWER
FileName.Runtime.pre-Unity.6.5.cs #if !UNITY_EDITOR && !UNITY_6000_5_OR_NEWER

Step-by-Step Process

Step 1 — Read the Source File

Read $ARGUMENTS (the target file path). Identify which parts need version-specific code.

Step 2 — Identify the Split Points

Common differences between Unity 6.5+ and pre-6.5:

Unity 6.5+ Pre-Unity 6.5
EntityId int
EntityId.None 0
go.GetEntityId() go.GetInstanceID()
EditorUtility.EntityIdToObject(entityId) EditorUtility.InstanceIDToObject(instanceID)
ObjectRef.InstanceID is EntityId ObjectRef.InstanceID is int?

Step 3 — Create the Two Files

  1. Update the original .cs file to contain only the Unity 6.5+ version:
    • Set the preprocessor guard to include UNITY_6000_5_OR_NEWER
    • Use EntityId, GetEntityId(), etc.

Read the full file on GitHub · 120 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 120 lines · 59 tokens per session scan A b52243de0f1d

Subscribe to this mod's changes

unity-version-split is a skill published in the GitHub repository IvanMurzak/Unity-MCP (4,079 stars, last pushed 11d ago), licensed Apache-2.0. It adds 59 tokens to every session and 1,248 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.