Search Unity

HOT RELOAD - Edit Code Without Compiling!

Discussion in 'Assets and Asset Store' started by reese015, Jan 23, 2023.

  1. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,087
  2. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
  3. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released a hotfix v1.1.9.

    Fixes:

    • Various issues with file watcher on Windows
    • Error logs when "Allow Http" setting is disabled while the Hot Reload window is open

    Additionally, we made some major pricing changes based on community feedback:
    • Unity Personal users can get unlimited use for free, forever (same as before)
    • Unity Plus users can get unlimited use for $14.90/month, or $149/year (down from $24.99/month paid yearly or $29.99/month monthly)
    • Unity Pro/Enterprise users can get unlimited use for $41.90/month, or $419/year (down from $79.99/month paid yearly or $99.99 paid monthly)

    We are still constantly making adjustments and improvements based on user feedback and this includes pricing changes. If you have any additional feedback on the pricing options and think there are still better ways to do it, please let us know!

    Like mentioned before, we will soon be rolling out a major update supporting:
    • add/edit/remove generic methods
    • add/edit/remove method parameters (eg add 'int x', or change 'int y' to 'string y')
    • add/edit/remove method type parameters (for generics)
    • add/edit/remove method return types
    • edit accessibility modifiers (switch between public/private/protected/internal)
    • change method from static to non-static and non-static to static
    • renaming methods (incl generics)
    • add new methods
    • add new properties, events, or indexers

    We will also be hopefully rolling out proper debugger support in the coming week since it is in high demand.

    Thank you all for trying out Hot Reload so far and giving us all your feedback!
     
  4. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    A user on Reddit has a similar setup to you and informed us that they managed to get it working by installing the package via UPM instead of the .unitypackage.

    This information is quite valuable and should help us narrow down (and potentially fix) what the issue is. In the meantime, maybe this also applies to your scenario and this is something you can try doing?
     
  5. Cameo221

    Cameo221

    Joined:
    Aug 2, 2018
    Posts:
    37
    What a wonderful tool! I really like how I can make changes to editor scripts like Imgui and it reflects instantly in the inspector. Such a better process than waiting a few seconds every time :)
     
    Koara92 likes this.
  6. Pnvanol

    Pnvanol

    Joined:
    Jan 11, 2016
    Posts:
    115
    I'm getting this error when trying to build:
    Exception: No HotReloadSettingsObject found.
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    Edit: solved by ticking off on settings include hotreload on player builds
    Edit2: getting the same error on the build
     
    Last edited: Feb 9, 2023
  7. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    These are all the settings Hot Reload toggles for you when you ask it to:

    1. Disable Unity Auto Refresh. Can be found in the preferences
    2. Set the 'Script Changes While Playing' preference to "Recompile After Finished Playing". This can also be found in the preferences
    3. Enable project generation for local and embedded packages. Can be found in the preferences under "External tools" here
    4. For Unity 2022 and up, allow http for development builds so hot reload can work properly. This can be found in the player settings

    I'll see if we can get the FAQ updated with this information! Also please let me know if reverting all these settings still doesn't fix your issue.
     
  8. TroyDraws

    TroyDraws

    Joined:
    Apr 29, 2017
    Posts:
    13
    @Pnvanol you can fix the build failing by disabling '[Player] Include Hot Reload in player builds' and saving/commiting the new file `Assets/HotReload/HotReloadSettingsObject.asset`.

    I tested in Unity 2020.3 and this fixes the issue for me.

    It sounds like you already found this option and still have a build error though? Please make sure you followed these screenshots and let me know if you still see a build error.

    Step 1: Unity screenshot step 1.png
    Step 2: Unity screenshot step 2.png

    This error will be fixed properly in the release which includes on-device support (likely within 7 days).

    -Troy (Hot Reload developer)
     
    Pnvanol likes this.
  9. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    If I understand you correctly, you are making some changes and then looking at the script in the inspector window of the Unity editor to see if the changes are there? The changes made from Hot Reload will not be visible in the inspector window unless you do a compile like you suggested - however, the changes are still applied and still work.

    Where Hot Reload really shines is making changes while you are in playmode. For example, if you are in playmode and edit the position of GameObject in the Update method, you should almost immediately see the changes reflected in the game after saving the file. At the same time, the script changes will not be visible if you try to select the C# script in Unity and preview it in the inspector window.

    I hope this answers your question, but feel free to let me know if I misunderstood.
     
  10. NikolaNikolov

    NikolaNikolov

    Joined:
    Jan 14, 2014
    Posts:
    3
    After reverting everything Visual Studio still doesn't refresh Unity's AssetDatabase on save. Reinstalling both Visual Studio and Unity didn't help either. And it's broken for all of my projects not just the one I imported Hot Reload into.
     
  11. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    What about setting the Auto Refresh mode to "Enabled outside PlayMode" in the Asset Pipeline preferences?
     
  12. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,087
    Still in 1.1.9, I didn't mention that it keeps running also after closing Unity.
     
    AlphaDreams likes this.
  13. AlphaDreams

    AlphaDreams

    Joined:
    Jan 21, 2015
    Posts:
    30
    Hello, I've been testing this plugin for two days and it's really great!

    However, it seems that I have a couple of bugs (some blocking, some not) :

    The first is that I just upgraded to Hot Reload 1.1.9 (previously on 1.1.8) and the hot reload console doesn't seem to track the changes that I do on my code. It was working flawlessly in the previous version, but now it simply doesn't work. There are no errors, the console still says that "Hot Reload Server is ready", and the Hot Reload panel in Unity says that the number of "patches" stays at 0. I'll go back to 1.1.8 for the moment.

    The second one is that I sometimes have an error in the console that says that a Native Collection hasn't been properly discarded and that it has produced a memory leak. Even if I enable Unity to display the full stack trace, It doesn't print it, so I don't have any additional information to provide... But it's not constant, and is even not blocking at all. Just curious.

    The third (and final !) one is that I have a bunch of warning printed to the console when I enter play mode because the Visual Scripting package seems to have a hard time figuring what the hell is the Hot Reload package (stuff like "Failed to fetch defined attributes on ..."). Once again, it's not blocking us, it's just warnings, and it seems to be a bug from the visual scripting package.

    An example of the warning :

    Failed to fetch defined attributes on System.Collections.Generic.IEnumerable`1[SingularityGroup.HotReload..‮‪‪‌‏‏‭‮‌‏‍‪‭‏‮‫‌‪‏‍‫‬‪‭‮] ‌‫‪‫‬‪‍‍‮‫‮‏‫‮‍‍‏‫‪‏‍‪‫‮(System.Collections.Generic.IEnumerable`1[SingularityGroup.HotReload..‮‪‪‌‏‏‭‮‌‏‍‪‭‏‮‫‌‪‏‍‫‬‪‭‮], System.String).
    System.TypeLoadException: Could not load type xpOM!xdtj7|lHK$S\&<OE-3b5"+^M3#\*Y=K=9Hjsfe%kv:^5PGE\* while decoding custom attribute: (null)
    at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal(System.Reflection.ICustomAttributeProvider,System.Type,bool)
    at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00013] in <e40e5a8f982c4b618a930d29f9bd091c>:0
    at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in <e40e5a8f982c4b618a930d29f9bd091c>:0
    at System.Reflection.RuntimeMethodInfo.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in <e40e5a8f982c4b618a930d29f9bd091c>:0
    at System.Attribute.GetCustomAttributes (System.Reflection.MemberInfo element, System.Boolean inherit) [0x00052] in <e40e5a8f982c4b618a930d29f9bd091c>:0
    at Unity.VisualScripting.AttributeUtility+AttributeCache..ctor (System.Reflection.MemberInfo element) [0x0009a] in [....]\Library\PackageCache\com.unity.visualscripting@1.7.8\Runtime\VisualScripting.Core\Reflection\AttributeUtility.cs:73
     
  14. AndreasClifftop

    AndreasClifftop

    Joined:
    Jun 25, 2020
    Posts:
    5
    I've been testing this awesome tool for the last few days. Really looking forward to debugging support! I have a few other issues:
    - Per seat license seems to actually be per computer? I'm running Unity Plus and work from an office and from home, I was testing out the free trial. I might have done something incorrectly here, I activated the same email on two computers, first at the office then at home. That worked but it sent me two different activation emails with the same password. But when I returned to the office it said that the license has already been activated ("This license key has already been activated the maximum number of times") and Hot Reload is now disabled. Haven't gone home yet to check so I'll report back what it shows there.
    - ALL auto-reloading seems to be disabled when using Hot Reload. Which means that if I update an asset (sprite, sound, etc) I must manually force an update. Which is cumbersome and easy to forget. Is there any way to just disable auto-reloading for code so everything else auto-reloads? The fact that you have to press CTRL+R to reload should definitely be mentioned in the documentation also.
    - Line numbers in debug log error output is lost for edited methods, I'm hoping this will return with debugging support?

    A harder to pin down issue I've had is that Hot Reload tried to recompile a file I never changed but which had Å Ä Ö characters in a few comments; Hot Reload would then swap them out with gibberish. This also caused some issues with Perforce as the file was locked which completely crashed the compilation.
    I can't test it out more right now as Hot Reload is disabled, as mentioned above.

    I can understand that things are changing rapidly but did you remove the trial completely? Just two days ago the trial was changed from 7 days to 30 days but now the pricing page has no mention of a trial.

    Thanks for being so active here and actively fixing things!
     
  15. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    The 30-day free trial still exists! It's addressed in the FAQ area on the pricing page below the pricing cards.

    We've been playing around a lot with the pricing page to try to make things as clear as possible, but it seems like with each change we make there is still some confusion about at least one aspect. We'll make some other changes to hopefully make this a bit more clear!

    I'll get back to you (and anyone else here who hasn't received a response yet) about the other issues as soon as I have more information.

    Thanks!
     
  16. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    It would be great if you could provide us the email address you activated with so we can investigate what's going on.

    Could you send me a private message here on the Unity Forum or send us a message through the contact form on our website?
     
  17. AndreasClifftop

    AndreasClifftop

    Joined:
    Jun 25, 2020
    Posts:
    5
    Oh, my bad then! I checked when I got my license issue and I saw that it had disappeared from the cards and sadly I didn't look any further.

    I've sent you a PM regarding the license issue.
     
  18. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    165
    It must be something else. Reverted all the params you mentioned but nothing fixes the refreshing issue. It's not project related, it's global for Unity, because all other projects keep failing to auto refresh even I installed HR in just one. Btw, it's about how Visual Studio Tools for Unity connects with the Unity Editor, that thing doesn't work as expected anymore.
     
  19. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Yes, that seems to be it for some reason. I just installed with UPM and it seems to be working great now
     
  20. NikolaNikolov

    NikolaNikolov

    Joined:
    Jan 14, 2014
    Posts:
    3
    I've tried both "Enabled outside PlayMode" and "Enabled" and it still doesn't work.
     
  21. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Hi @Koara92. I found that the handle usage is quite high.
    Is that expected behaviour?
    version: Rider2022.2.3 Unity2022.1.23 Snipaste_2023-02-10_13-30-36.png
     
  22. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    It's working great, but if I switch branches, the new files on the new branch are missing until I restart Unity. Is this expected behavior? And if so, is there a way to get the editor state updated without a full exit and restart of Unity?
     
  23. Benjii

    Benjii

    Joined:
    Dec 22, 2012
    Posts:
    2
    I don't see and changes (no changes in Play Mode) until I do a manual Refresh. Doesn't matter if I stop/start Unity, I'm not seeing the changes of the code until I Refresh.
     
  24. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    We don't use watchman anymore with 1.1.9, so this is likely a leftover process from the previous version.

    You can just kill the process and it shouldn't come back.

    1. It looks like the new file watcher we are using is less reliable than the one we were using before. We will consider moving back to the previous file watcher again, but it will take some time to weed out all the issues with it. For now it would be best to stick with the version which is working without issues for you.

    2. This error was mentioned somewhere else on this thread previously, so we'll probably mention it in the FAQ on our website as well. So far as we can tell, this is a bug in UnityWebRequest. It is trying to dispose an upload handler from a previous domain. We properly dispose every web request object, including upload and download handlers and abort pending requests before the domain reload. However, it still prints this error. The error won't cause any issues and can be safely ignored. If it bothers a lot of people, we can swap out the web request client implementation. Though that can have other drawbacks and needs to get tested properly. It didn't seem worth it to just get rid of a harmless error but we will consider it.

    3. This is a new issue that we weren't aware of yet. We can't guarantee that it will be part of the next upcoming release, so it might be 1-2 weeks off to get a fix for this.
     
  25. rheirman

    rheirman

    Joined:
    Sep 30, 2019
    Posts:
    34
    I'm not sure what happened. I tried this asset yesterday and the day before, and it was working great. I updated yesterday while the asset was running, and it kept working. Today I started up Unity again, and it completely stopped picking up any changes I made. I suspect it's the update, but it's still strange it worked yesterday with the update. I'll try going back to an earlier version now.

    Edit: Going back to v1.1.8 fixed it for me.
     
    Last edited: Feb 10, 2023
  26. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Can I use one centralized account to purchase licenses for the team without sharing my account password? Or should every separate email have a separate account with separate billing for each?

    Billing & activation process seems to be nightmare-ish to be honest. You cannot log out after you log in via editor, you cannot sign up again, trying to sign up on another device, even for trial period, locks the account to the device. Removing license is unavailable via the dashboard with permission error, so resetting anything without contacting support is unavailable. I also see nothing related to billing in the licensespring dashboard.

    All I ever wanted to do is to log out from personal account after testing and sign up with company account + purchase a seat for each developer.
     
    andreiagmu likes this.
  27. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Yes, auto-refresh gets disabled but it should only be while you are in playmode; outside of playmode, it should auto-refresh as usual. We can add a feature request to still auto-refresh other non-code assets. The reason we didn't do this initially is because of how large our project is. As projects grow, most studios turn auto-refresh off to control when the expensive recompile and reimport process should start. This is not something we would prioritize in the near future, however if there is a lot of community feedback we will reconsider it.

    Yes, the line numbers will be fixed with proper debugging support.

    The file replacing will be fixed in the next release which should be coming very soon.
     
  28. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    @iMobCoding @NikolaNikolov

    We found what we believe to be the issue. For now the workaround would be to add the following code into an editor script and run it once:

    Code (CSharp):
    1. UnityEditor.EditorPrefs.SetInt("kAutoRefresh", 1);
    If you do still have Hot Reload added, it will show a warning that auto refresh is enabled after running the code. This can be ignored for the time being. The upcoming release will remove this warning.

    Let me know if this solves the issue or not!
     
    iMobCoding likes this.
  29. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Are you referring to Unity? We don't have control over what file handles Unity keeps open. We are not actively keeping file handles open, and dispose all handles shortly after opening them.

    Did you see an increase in handle usages in Unity.exe after installing Hot Reload?

    Hot Reload doesn't currently detect new files, so you would just need to manually refresh the assets and it will import and new files and recompile. On Windows this would be Ctrl + R, and on Mac this would probably be Command + R (can't confirm because I'm not using a Mac right now). If you're not sure what the keyboard shortcut is, you can also refresh by going clicking on Assets > Refresh.
     
  30. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    165
    Yes, that was it :)
    Please include this in the FAQ or in the process of uninstallation.

    Btw, I saw it was located in the Computer\HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Unity Editor 5.x (windows) under the kAutoRefresh value, so please let me know if you're changing anything else there during the installation?
     
    Scalisco likes this.
  31. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    I'm really sorry for the inconvenience. This indeed does sound very annoying, so I've let one of our coders know and we will try to get things sorted out with a proper logout button without all the limitations as soon as possible. We are still learning and figuring out the most common pain points for users, so we appreciate the input and will do our best to make sure this is fixed for you and anyone else who runs into this in the future.

    I just saw your email and will respond to that as well shortly.

    Thank you for your patience, and sorry again for the inconvenience!
     
    andreiagmu and IgorBoyko like this.
  32. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Thanks for your reply. Retuning back to the original question, our billing team would like to manage everyone from one dashboard, is that possible? Do I have to take some extra steps before purchasing seats to assign them to different email addresses on a single domain?
     
  33. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Right now it's not properly supported, but we can definitely make it possible to do seat management like you're asking.

    We will try to get this sorted out as soon as all the major hiccups related to logging out and device restrictions are handled. I'll keep you posted!
     
    IgorBoyko likes this.
  34. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    63
    It is not working. Code changes are not shown in the console.

    UPD: It only works if I manually reimport the script that I changed.

    Unity 2021.3.15f1, Visual Studio 2022 + Resharper

    upload_2023-2-10_20-32-5.png

    upload_2023-2-10_20-32-14.png
     
    Last edited: Feb 10, 2023
  35. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    68
    Hi Koara92, the reddit user with the macbook issue here ! After few hours use of the hot reload, the only "issue" I have is that I would like to be informed in some way that the code was updated successfully in the game window. It's not that big of an issue, it's awesome to see it working. I'll add more details after few days of using it.
     
  36. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hi there! This is likely the same issue with the file watcher as what a few other users have mentioned above. It should be fixed in the coming release.

    In the meantime, you can try downgrading to version 1.1.8 like a couple other people. You can do this by just changing the '1.1.9' part to '1.1.8' in the Package Manager download link found on our website.

    Glad to hear it's working smoothly for you now!

    You can already see some of the patches inside of the Hot Reload editor window itself. I guess you don't feel like this is sufficient or obvious enough in your opinion?
     
    Chaiker likes this.
  37. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    205
    Piggybacking off of @Francoimora 's request - my feature request would be to have an in-editor notification when HotReload could not successfully update the code (that doesn't require having any extra windows open or anything to see it). I'm not sure if its possible, but if there was a way to have a status icon in the bottom right corner of the Unity Editor window, that would be super helpful - and simply making it red or something like that when HotReload couldn't update.

    hotreloadicon.png
     
    andreiagmu, ksf000 and dancinLion like this.
  38. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.3.4.

    Features:
    • Add/edit/remove generic methods
    • Add/edit/remove method parameters (eg add 'int x', or change 'int y' to 'string y')
    • Add/edit/remove method type parameters (for generic methods)
    • Add/edit/remove method return types
    • Edit accessibility modifiers (switch between public/private/protected/internal)
    • Change method from static to non-static and non-static to static
    • Renaming methods (incl generics)
    • Add new methods
    • Add new properties, events, or indexers

    Fixes:
    • fixed hot reload support for mac m1 (silicon)
    • better Hot Reload console window for mac
    • fixed Hot Reload sometimes not detecting file changes on windows
    • fixed C# files getting modified automatically while hot reload is running
    • fixed issue where multiple projects with the same name in the solution would cause a failure when hot reload starts.
    • fixed visual studio not auto refreshing unity anymore after installing hot reload
    • fix build failure when making a player build while having the hot reload window open
    • fix an il2cpp build failure caused by a dll from the hot reload package

    We already spent a couple weeks testing all the new C# additions internally, but please let us know if you run into any issues!

    If you don't see the update button in your Hot Reload window yet, it should be visible after a quick restart of the Unity editor.

    Thanks again for all your feedback and bug reports so far!
     
    TroyDraws, eterlan, nogxx and 2 others like this.
  39. Scalisco

    Scalisco

    Joined:
    Feb 2, 2014
    Posts:
    20
    I'm getting this error when I try editing a file with TextMeshPro

    upload_2023-2-11_4-17-40.png
     
  40. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Are you using a modified TextMeshPro package? If so, do you have project generation enabled for embedded and local packages?



    Hot Reload should prompt you to enable this on install.

    Let me know if these settings are correct or not. If the settings are correct, then it might be on our end.
     
  41. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    There shouldn't be anything else other than the settings I mentioned in a previous post. However if you still believe there is something off, let me know!

    We plan on adding something to the FAQ to show people which settings need reverting when the extension is removed. However from now on, users won't need to run any code to get the changes reverted - this was a bug on our end. Basically Unity uses a different editor pref key for auto refresh depending on the Unity editor version you're using. We now set the proper pref depending on your Unity version when you apply the settings through the Hot Reload window, so users won't need to run some code manually anymore.

    Thanks for making us aware of the issue and helping us make the product better!
     
    iMobCoding and andreiagmu like this.
  42. ksf000

    ksf000

    Joined:
    Mar 15, 2021
    Posts:
    6
    Thank you for updating and listening to us!
    1) Is it possible to make a connection between Unity Debug.Log in a new realtime code and unity console? To make console show the place in code it was called from
    2) I create Update method in runtime and it's not called as a typical monobeh until I refresh unity code as usually.
    3) I think it's same as 2nd. If I remove completely void Update(){} then nothing changes, but if I remove only body of the Update - it works
     
    Last edited: Feb 11, 2023
    andreiagmu likes this.
  43. unity_9F3505742B0E07BA5991

    unity_9F3505742B0E07BA5991

    Joined:
    Jan 14, 2023
    Posts:
    1
    Hi, i tried this out and it didn't work due to an error. It would not compile.(some error with duplicate key in unity timeline) Then I decided to remove it again by removing it in the package manager. Now I have the error
    "error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Users\user\unity\TurnBaseStrategyCourse\Assets\Packages\Microsoft.CSharp.4.7.0\lib\netstandard2.0\Microsoft.CSharp.dll' and 'D:\unity\2022.2.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll'. Remove one of the duplicate references."
    I tried removing the first of the two by deleting the folter in Packages. That did not work. It seems to just redownload it. As I am new to C# and Unity I have no idea what happened and how to fix it. Any idea? I really dont feel like copying over all my stuff into a new project :/
     
  44. Fuzzeh

    Fuzzeh

    Joined:
    Feb 7, 2016
    Posts:
    3
    Cool stuff! I did run into one issue:

    I have an automated build system that runs on a different machine than what I use to develop on. Creating builds on my development machine seems to work fine with hotreload installed, but builds created on the remote system seem to "hang" and require me to manually terminate the process, otherwise it will run forever. Is this a known issue?

    I'm on 2021.3.18f1, hotreload 1.3.4, with ['Player] Include Hot Reload in player builds' unchecked
     
    Last edited: Feb 11, 2023
    IgorBoyko likes this.
  45. Scalisco

    Scalisco

    Joined:
    Feb 2, 2014
    Posts:
    20
    These settings were correct and it's not a custom TMP.

    Oddly enough, it started working after I restarted Unity. So, good!
     
    Koara92 likes this.
  46. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    1. This will happen by default when we add debugging support.
    2. Yes, adding and removing Unity methods (like Update) is not supported right now. We will support it in the future though.
    3. Yes, commenting out the method body will work, but removing the entire method will not. Internally we found that it was straight forward to just comment out the body, so we didn't put effort into supporting commenting out the entire method.
     
    ksf000 likes this.
  47. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    Installed absolutely instantly!

    But... getting a steady compilation error.

    upload_2023-2-12_3-33-19.png
     
  48. ksf000

    ksf000

    Joined:
    Mar 15, 2021
    Posts:
    6
    Okay, then I think you need to show a mark in unity that indicates whether all scripts are updated or not. Because I have to update code and restart the whole game as usually when I face an unexpected behavior.
    Thank you
     
  49. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    @Koara92 Hi, I found that it can't patch method which marked "[Button]" provided by Odin inspector, is there any specific reason? That would be super useful if this is supported.
    Failed to apply patch for method System.Void Test.Tester::TestTemp() in assembly Assembly-CSharp
    System.TypeLoadException: Could not resolve type with token 0100000c from typeref (expected class 'GameEntity' in assembly '')
    at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
    at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <8f06425e63004caf99a79845675f751e>:0
    at SingularityGroup.HotReload.MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) [0x00000] in <d63512255f134cbcb33af01edad8ae57>:0
    at SingularityGroup.HotReload.MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) [0x000b8] in <d63512255f134cbcb33af01edad8ae57>:0
    at SingularityGroup.HotReload.MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) [0x00005] in <d63512255f134cbcb33af01edad8ae57>:0
    at SingularityGroup.HotReload..‮‌‏‫‍‌‮‬‮‭‬‭‌‬‍‪‌‏‏‮.‏‍‌‭‌‬‬‫‭‫‪‭‎‮‎‏‬‮‌‏‭‭‮ (System.Reflection.MethodBase , System.Exception& ) [0x0002f] in <d63512255f134cbcb33af01edad8ae57>:0
    UnityEngine.Debug:LogWarning (object)
    SingularityGroup.HotReload.CodePatcher:HandleMethodPatchFailure (SingularityGroup.HotReload.DTO.SMethod,System.Exception) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:308)
    SingularityGroup.HotReload.CodePatcher:patchMethod (System.Reflection.Module,SingularityGroup.HotReload.DTO.SMethod,SingularityGroup.HotReload.DTO.SMethod) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:211)
    SingularityGroup.HotReload.CodePatcher:HandleMethodPatchResponse (SingularityGroup.HotReload.DTO.MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:164)
    SingularityGroup.HotReload.CodePatcher:ApplyPatches () (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:86)
    SingularityGroup.HotReload.CodePatcher:RegisterPatches (SingularityGroup.HotReload.DTO.MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:66)
    SingularityGroup.HotReload.Editor.EditorCodePatcher:HandleResponseReceived (SingularityGroup.HotReload.DTO.MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Editor/EditorCodePatcher.cs:113)
    SingularityGroup.HotReload.Editor.EditorCodePatcher/<>c:<OnIntervalMainThread>b__7_0 (SingularityGroup.HotReload.DTO.MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Editor/EditorCodePatcher.cs:107)
    SingularityGroup.HotReload.RequestHelper/<PollMethodPatches>d__19:MoveNext () (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/RequestHelper.cs:86)
    System.Threading.Tasks.TaskCompletionSource`1<UnityEngine.Networking.UnityWebRequestAsyncOperation>:TrySetResult (UnityEngine.Networking.UnityWebRequestAsyncOperation)
    SingularityGroup.HotReload.RequestHelper/<>c__DisplayClass14_0:<SendRequestAsync>b__0 (UnityEngine.AsyncOperation) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/RequestHelper.cs:48)
    UnityEngine.AsyncOperation:InvokeCompletionEvent ()
    TypeLoadException: Could not resolve type with token 0100000c from typeref (expected class 'GameEntity' in assembly '')
    System.RuntimeMethodHandle.GetFunctionPointer () (at <8f06425e63004caf99a79845675f751e>:0)
    SingularityGroup.HotReload.MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) (at <d63512255f134cbcb33af01edad8ae57>:0)
    SingularityGroup.HotReload.MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) (at <d63512255f134cbcb33af01edad8ae57>:0)
    SingularityGroup.HotReload.MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) (at <d63512255f134cbcb33af01edad8ae57>:0)
    SingularityGroup.HotReload..‮‌‏‫‍‌‮‬‮‭‬‭‌‬‍‪‌‏‏‮.‏‍‌‭‌‬‬‫‭‫‪‭‎‮‎‏‬‮‌‏‭‭‮ (System.Reflection.MethodBase , System.Exception& ) (at <d63512255f134cbcb33af01edad8ae57>:0)
    UnityEngine.Debug:LogException(Exception)
    SingularityGroup.HotReload.CodePatcher:HandleMethodPatchFailure(SMethod, Exception) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:309)
    SingularityGroup.HotReload.CodePatcher:patchMethod(Module, SMethod, SMethod) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:211)
    SingularityGroup.HotReload.CodePatcher:HandleMethodPatchResponse(MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:164)
    SingularityGroup.HotReload.CodePatcher:ApplyPatches() (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:86)
    SingularityGroup.HotReload.CodePatcher:RegisterPatches(MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/CodePatcher.cs:66)
    SingularityGroup.HotReload.Editor.EditorCodePatcher:HandleResponseReceived(MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Editor/EditorCodePatcher.cs:113)
    SingularityGroup.HotReload.Editor.<>c:<OnIntervalMainThread>b__7_0(MethodPatchResponse) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Editor/EditorCodePatcher.cs:107)
    SingularityGroup.HotReload.<PollMethodPatches>d__19:MoveNext() (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/RequestHelper.cs:86)
    System.Threading.Tasks.TaskCompletionSource`1:TrySetResult(UnityWebRequestAsyncOperation)
    SingularityGroup.HotReload.<>c__DisplayClass14_0:<SendRequestAsync>b__0(AsyncOperation) (at Library/PackageCache/com.singularitygroup.hotreload@72bffb5e93/Runtime/RequestHelper.cs:48)
    UnityEngine.AsyncOperation:InvokeCompletionEvent()
     
    Last edited: Feb 12, 2023
  50. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Yes I'm sure about that. Can confirm this behaviour in multiple computers after running Hot Reload.