ScarPixel
Topic Author
Posts: 5
Joined: 20 May 2024, 23:34

Hot Reload in Unity

21 May 2024, 20:49

Hi, I'm evaluating the trial version of Noesis and having trouble getting hot reload working in Unity. I'm on Unity 2022.3.13f1 and have also tried 2022.3.29f1 (latest LTS).

I created an empty project, added the Noesis package, and imported a few samples. For instance, the Buttons sample. Running the scene in the editor works fine.

I have Visual Studio Code open with MainWindow.xaml. I change something simple, like a color, and save. The UI in the running scene does not update based on this change.

Exiting Play mode and restarting also does not update to reflect the changes in the xaml. Only if I save the file while outside of Play mode do my changes get reflected when running.

Here's a video demonstrating this process.


Appreciate any advice what I might be doing wrong.
 
User avatar
jsantos
Site Admin
Posts: 3959
Joined: 20 Jan 2012, 17:18
Contact:

Re: Hot Reload in Unity

23 May 2024, 19:21

What option do you have in Edit=>Preferences=>General=>Script Changes While Playing ?

You should have "Recompile And Continue Playing"

If you have something different, any change to any asset (not only XAMLs) won't reload while in play mode.
 
ScarPixel
Topic Author
Posts: 5
Joined: 20 May 2024, 23:34

Re: Hot Reload in Unity

23 May 2024, 20:54

Yep, good call. I do have it set to "Recompile And Continue Playing".
 
User avatar
jsantos
Site Admin
Posts: 3959
Joined: 20 Jan 2012, 17:18
Contact:

Re: Hot Reload in Unity

24 May 2024, 01:26

Are textures reloading correctly?
 
ScarPixel
Topic Author
Posts: 5
Joined: 20 May 2024, 23:34

Re: Hot Reload in Unity

28 May 2024, 23:48

I installed the Quest Log sample and tried modifying the background image while running. I got the same result as before. It didn't hot reload the background after changing MainWindow.xaml.
 
User avatar
jsantos
Site Admin
Posts: 3959
Joined: 20 Jan 2012, 17:18
Contact:

Re: Hot Reload in Unity

29 May 2024, 13:36

Could you please check the following things?

1. Is hot-reloading working in Unity? Like, are you able to recompile a script while in play mode or change a texture (not a NoesisGUI texture) in the 3D-scene?
2. Project Settings => NoesisGUI => Editor Settings => Reload Enabled should be 'True' (the default value)
3. In NoesisPostprocessor.cs, if you uncomment the first line (//#define DEBUG_IMPORTER) you should get debug messages whenever any XAML is reported as changed by Unity. Are you getting this message? If not, this indicated that Unity is not reporting changes while in Play mode because there is a setting disabling that.
 
ScarPixel
Topic Author
Posts: 5
Joined: 20 May 2024, 23:34

Re: Hot Reload in Unity

29 May 2024, 23:52

I tried installing an older version of Unity, and hot reload works fine. So maaaybe it's a Unity thing? Based on the discussion here I went back to 2021.3.5f1. I haven't done a bisect to find out what versions do and don't work (or if the problem is actually something else).
I'll be digging into this a bit more in the next week or so.
 
ScarPixel
Topic Author
Posts: 5
Joined: 20 May 2024, 23:34

Re: Hot Reload in Unity

29 May 2024, 23:53

Also, to partially answer your question, reloading of scripts was also not working for me in 2022.3.13f1. That's what made me go searching for possible reasons/solutions when I came across that Reddit thread.
 
User avatar
jsantos
Site Admin
Posts: 3959
Joined: 20 Jan 2012, 17:18
Contact:

Re: Hot Reload in Unity

30 May 2024, 01:27

Thanks for the update, this is definitely an issue on Unity.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 8 guests