Unity's experimental MethodReload skips domain reload, on device too
Unity has released MethodReload, an experimental package that swaps in edited method bodies without a domain reload, in the Editor and on IL2CPP development players. It covers small gameplay tweaks only and runs a subset of C#.
Digital Developer Desk, 12h ago, 3 min read
Unity has made MethodReload available as an experimental package. Tag a method with the [MethodReload] attribute, start the watcher, enter Play Mode or attach a development player, and edit the body. The running instance picks up the new body on its next call. Unity says it demoed the feature on stage at Unite Seoul.
The package is com.unity.pipeline, currently at 0.7.0-exp.1, and it requires Unity 6.0 or later. Install it through the Unity CLI or Package Manager using "Install package by technical name". Unity notes that the process may change because the feature is experimental. Tagged methods must be public, instance or static, and return void or IEnumerator. Anything else is skipped at build time with a warning.
The key limit is scope. A reload changes only tagged method bodies and never touches call sites, fields or type layout. A reloaded body can declare and call a new method, but that method cannot itself be a reload entry point. Edits run through a hand-built interpreter, so some C# is off limits inside tagged bodies, including await and Task, try/catch/finally, lock, LINQ query syntax, ref/out/in parameters and generic methods. A Roslyn analyzer ships with the package and flags violations in the IDE.
On device, interpreted code can only call APIs the player already exposes, because IL2CPP strips unreferenced code. The push lists missing members as warnings, and the code throws an exception if it reaches one. Interpreted code is also slower than compiled code, but only for tagged methods in development builds. In release builds, a tagged method just runs its compiled body. Coroutines pick up changes only when started, and in-flight ones keep their old body. An [OnMethodReloaded] callback can restart long-lived loops.
Unity compares it with existing tools. Asset Store packages patch a running Mono runtime and offer full C# in reloaded bodies, but they do not work with IL2CPP players. .NET Hot Reload in Visual Studio and Rider targets CoreCLR, not Unity's Mono or IL2CPP. Unity's own advice is that if your iteration pain is in the Editor, keep using mature tools. If it is on an IL2CPP device, MethodReload is the one to try. It suggests testing in the Editor first, since the same interpreter runs there, and says the command reference and constraint list are in the com.unity.pipeline docs.
Sources
Get the daily brief
The five stories that matter, every weekday morning. Free.
Unreal ue6-main drops VS2022 support; minimum MSVC now 14.50.35723
A community roundup of recent Unreal Engine source commits says the ue6-main branch no longer supports the VS2022 compiler. It also lists fixes on ue5-main, including one for a Mac editor crash, that 5.8 users may want to cherry-pick.
reddit.com3d ago2 min read
Godot 4.8 Beta 1 adds embedded game view, Trail3D and mip-level texture streaming
Godot 4.8 Beta 1 is out, with a reworked editor UI, a native Trail3D node and mip-level texture streaming. It is a beta and not for production use, per GameFromScratch.
gamefromscratch.com3d ago2 min read
RocketWerkz and Ahwoo release BRUTAL, an open source C# game framework
RocketWerkz and Ahwoo, both founded by Dean Hall, have announced the open source release of BRUTAL, a C# framework for building your own engine or game from scratch. It is free for commercial use, but it asks for more hands-on programming than an engine like Godot.
gamedeveloper.com3d ago3 min read