Rekey - EntityId Migrator for Unity 6.5+
A downloadable tool
Unity 6.5 says error CS0619: 'Object.GetInstanceID()' is obsolete: 'Use GetEntityId instead.' and your project stops compiling. Rekey gets it compiling again.
Unity 6.5 turned the instance ID APIs into compile errors and made EntityId 64-bit, and Unity's own migration guide says its script updater does not migrate the main InstanceID APIs for you. Rekey does. It renames each obsolete call to the replacement Unity names, then follows the value through your code: the int local that held it becomes EntityId, then the field, the parameter, the return type and the Dictionary<int, ...> or HashSet<int> it keys. Where a change would quietly alter behaviour, it stops and tells you why.
Measured on Unity 6000.5.7f1
- A test project with pre-6.5 caches, an object pool and editor lookups: Unity refused to compile it.
rekey fixmade 22 rewrites in 3 files over 4 rounds. Unity then compiled it with 0 errors, and a behaviour check on the migrated code passed (lookups, pool counts, editor resolves). - A second project full of shapes that must not be touched: serialized int fields,
PlayerPrefs.SetInt, arithmetic on ids,GetHashCode. Rekey refused all five with a reason, and every error Unity still reported was one of those five lines. - Both tested from the shipped .unitypackage, imported into blank projects.
Why it runs outside the editor
A project with compile errors cannot load new editor code. We measured it: a clean editor tool beside one CS0619 compiled and was never loaded. So an in-editor migrator cannot run in the exact situation you need it. Rekey is a launcher you run from a terminal. It compiles itself with the Roslyn compiler and .NET runtime your Unity 6.5 editor already ships (nothing is downloaded), replays the compile instructions Unity wrote for your project, and fixes what it finds.
How you use it
- Import Rekey. Open the project once in Unity 6.5+ so it writes its compile instructions (failing to compile is fine), then close it.
Assets\CSAF\Rekey\Cli\rekey.cmd scanis a dry run: it changes nothing and writes a ledger page.rekey.cmd fixwrites the rewrites, backing up every file first.rekey.cmd restoreputs them back.- Open the project in Unity. Unity's own compile is the final word.
The ledger
Every run writes Library/Rekey/latest.html: the EntityId error count before and after, a card for each rewritten file with each changed line before and after, the order the change travelled through the file, and every refused site with its reason and Unity's own message.
What it rewrites, and what it refuses
- Renames come from Unity's own
[Obsolete]text in the editor you have installed, never from a list we wrote, and only when the replacement exists on that editor. - Retypes int locals, fields, parameters, return types and collection keys that carry an id. A file without
using UnityEngine;getsUnityEngine.EntityId. - Refuses serialized int fields (your saved data would not follow), ids passed to APIs that only take an int, arithmetic and ordering on ids, explicit
(int)casts,GetHashCode, overrides, interface signatures and lambdas.
Compatibility
- Unity 6.5 or newer, installed. Tested on 6000.5.7f1.
- Windows (PowerShell 5.1, built into Windows 10 and 11). A macOS/Linux launcher (
rekey.sh) is included but we have not tested it on those systems. - Edits code under
Assets/and embedded packages underPackages/. Packages inLibrary/PackageCacheare read, never edited. - Does not write
#if UNITY_6000_5_OR_NEWERdual versions of your code.
What is in the download
A .unitypackage plus the same files as a plain folder: the launcher and its full C# source (it ships as .cs.txt so Unity never compiles it into your project), an editor menu (Tools > CSAF > Rekey) for a project that already compiles, a demo scene showing an EntityId-keyed cache, a numbered offline guide, the Readme and the licence.
Also from the studio
CoreCLR Migration Scanner ($14.99): the other half of the Unity 6.x move. It audits your project for the hazards that break when Mono goes away.
Rekey and its documentation were written with AI assistance (code and store images). It was tested by us on real Unity projects, as described above.
| Published | 3 days ago |
| Status | Released |
| Category | Tool |
| Author | CSAF — Core Systems Asset Factory |
| Made with | Unity |
| Tags | csharp, editor, programming, source-code, tool, Unity, unity6, unity-editor, utility, workflow |
| Languages | English |
| AI Disclosure | AI Assisted, Code, Graphics |
Purchase
In order to download this tool you must purchase it at or above the minimum price of $14.99 USD. You will get access to the following files:






Leave a comment
Log in with itch.io to leave a comment.