Edit C# during Play Mode and see the change immediately, without losing runtime state. Compiles with the same Roslyn Unity uses, so C# 9 works.Every iteration on gameplay code costs you the same tax: stop Play Mode, wait for the domain to reload, replay the setup, get back to the moment you were testing. RuntimeCode removes that loop. Save a file while the game is running and the change is live in under a second, with your scene, your position, and your serialized state intact.WHAT IT DOESRuntimeCode watches your scripts, compiles the changed file with the same Roslyn compiler that ships inside your Unity installation, and puts the new code into the running game. Because it is Unity's own compiler, the language level is whatever your Unity supports — records, init-only properties, switch expressions and pattern matching all compile.Two mechanisms, chosen automatically:Method patching redirects the running method in place. Instances are untouched, so everything on them survives: fields, coroutines, event subscriptions, Update state. Available on Windows, Intel macOS and x64 Linux.Component replacement rebuilds the affected components from the new type and carries the serialized state across. Available everywhere, including Apple Silicon macOS.The package tests which mechanism actually works on your machine at startup — it patches one of its own methods and verifies the result — rather than assuming from the platform name. If patching is unavailable, it says so plainly and falls back.WHAT YOU SEEA single editor window shows the compile result, the reload strategy in use, and a log of every reload with its timing. Compile errors appear with file and line, in English, in the same window — you do not go hunting through the console.WHAT IT DOES NOT DOIt reloads method bodies and component code. Adding a field to a MonoBehaviour changes the serialized layout, and that still needs a normal domain reload — the window tells you when this is the case instead of silently doing nothing.Compiles with Roslyn, the same compiler Unity already ships. C# 9 syntax works, no separate toolchain to install.Play Mode state survives the reload: score, health, positions, elapsed time all carry over.Two reload strategies, picked automatically per platform. Direct method patching on Windows x64 and ARM64, macOS Intel, Linux x64. Component replacement on macOS Apple Silicon and Linux ARM64, where the OS refuses to let managed code write into JIT memory.Self-test at start-up: it patches one of its own methods and confirms the result really changed before claiming the feature works.Patch log in the window, not the console: every reload with its file and how long it took.When an edit cannot be hot-reloaded (a new serialized field changes the layout) the window says so, instead of silently doing nothing.Editor-only. Nothing is added to your player build.Full C# source. No DLLs, no third-party binaries, no network calls, no external services.DOTS/ECS systems can be patched too, with a sample showing how.Three samples included: Basic Usage, Advanced Patterns, DOTS Integration.Unity 2022.3 LTS or newer.The C# source, the documentation and the store copy were written with the help of an AI coding assistant (Anthropic Claude), used the way a pair programmer would be: it drafted and revised code under direction, and every piece was read, corrected, and kept or thrown out by the publisher.No generated art, audio, textures or models are included. The package holds no art at all; everything in it is C# source and text.Correctness was established by running the package rather than by trusting the assistant: 147 automated tests ship with it and pass on Unity 6000.6, and the shipped .unitypackage was imported into an empty project and tested from there before submission.




