3 ms·
It looks like Unity does support runtime editing, or rather, "hot reloading": https://docs.unity3d.com/Manual/script-Serialization.html https://docs.unity3d.com
by dindresto 7y ago
It looks like Unity does support runtime editing, or rather, "hot reloading": https://docs.unity3d.com/Manual/script-Serialization.html https://docs.unity3d.com/Manual/script-Serialization.html
I didn't know that prior to you raising the question, so I can't say how well it works unfortunately.
- lasagnaphil 7y agoThe last time I used Unity (about 1~2 years ago), hot reloading was basically useless and I tried to avoid it as much as possible (some people actually disable to disable this feature to avoid any "accidental" runtime recompilation.) It messes with serialization too much that it only works with very, very simple cases.
- diegoperini 7y agoIn my experience, it only reliable works for singleton objects which have changes in their method bodies. Any change in the memory layout creates random null reference exceptions on each frame update.
- moron4hire 7y agoIt also depends on how you've designed your MonoBehaviours. If you have anything dependent on resources retrieved in your Awake event, those references will not be restored and the Awake event will not re-occur. So you either have to check and reacquire the references in your Update event (which is costly), or design everything around serialized fields that are set in the editor, with no objects acquired during Awake (which is intractable for anything but the most basic projects). Unity is designed to get the basic demo feature of whatever you're doing done as quickly as possible. But building a production-scale product is actually harder than just writing from scratch, as there are a lot of stupid design decisions in Unity that get in the way.