Lambdas & closures¶
Inline lambdas inside a method you are patching usually just work - the whole method is recompiled when you save.
Lambdas inside methods¶
Change the lambda, save the file, and the next Update uses the new version.
Lambdas stored in static fields¶
If s_transform was assigned earlier (Awake / Start), editing the lambda updates the method body, but the static field may still hold the old delegate.
What to do: Re-assign the field (re-run that setup code), or restart Play Mode.
Closures¶
Lambdas that capture variables that already existed keep working after a patch.
If you add a new captured variable, the closure updates only when that lambda is created again at runtime. Lambdas built each call (for example inside a sort comparer) pick up changes immediately.