unity-version-split

Installation
SKILL.md

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
Installs
1
GitHub Stars
4.6K
First Seen
Aug 21, 2026