Unity callbacks¶
If a Unity message already exists on your script when you enter Play Mode, you can edit it and see the change while the game keeps running.
Everyday example¶
Your PlayerController already has Update(). You change the jump force inside it, save, and the next frame uses the new value - scene state stays intact.
Messages Hot Patch understands¶
Every frame¶
Update, FixedUpdate, LateUpdate, OnGUI
Lifecycle¶
Awake, Start, OnEnable, OnDisable, OnDestroy
OnApplicationPause, OnApplicationFocus, OnApplicationQuit
OnBecameVisible, OnBecameInvisible
OnValidate, Reset
Input & physics¶
OnMouseDown, OnMouseUp, OnMouseEnter, OnMouseExit, OnMouseOver, OnMouseDrag
OnTriggerEnter, OnTriggerExit, OnTriggerStay
OnCollisionEnter, OnCollisionExit, OnCollisionStay
Animation & gizmos¶
OnAnimatorMove, OnAnimatorIK
OnDrawGizmos, OnDrawGizmosSelected
Editing vs adding¶
| Situation | Works? |
|---|---|
Edit an Update() that already existed |
Yes - next frame |
| Edit an existing collision / trigger handler | Yes - next event |
Add a brand-new Update() during Play Mode |
No - Unity only discovers messages at compile time |
If you add a new message mid-session, Hot Patch logs a warning like:
New Update() on MyScript requires Unity recompile to receive engine callbacks.
What to do: Exit Play Mode (or recompile in Edit Mode), then enter Play Mode again. Or edit a message that was already on the script.
Tip¶
Hot Patch does not re-fire one-shot messages like Awake / Start just because you edited them. Change something that runs again (Update, a button handler, a collision), or call the method yourself.