-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: UnityConvertersConfig asset not loaded when running Unity in batch mode #61
Comments
I'll do some manual testing to try and reproduce this. |
Was unable to reproduce this. Steps taken:
I was unable to reproduce the issue mentioned by @jchowdown in their discussion post. Hey @jchowdown, if you can post a reproducible guide like the one above that would be great. I've not tested the above in other Unity versions. |
Thanks in advance for getting back to me so quickly jilleJr, I really appreciate it. We're running |
Still trying to narrow this down but looks like this is happening due to some weird order-of-operations issue when opening a newly-downloaded Unity project and having to import assets, including the UnityConvertersConfig instance, for the first time. |
Yup, I confirmed that this is only a problem while using a cache server and running this for the first time on an yet-to-be-imported project. Basically the sequence of event goes:
I'm trying to call UnityConverterInitializer.RefreshSettingsFromConfig() manually right before we run the user code but UnityConverterInitializer is marked internal so I can't access it from our code. |
Glad you were able to nail the cause down. That class is marked as public starting with v1.2.0. I forgot to merge the PR for that (#59) but have released that in the midst of this issue tracking. If you get the newly released v1.2.0 and use the |
That change to 1.2.0 works like a charm, thank you very much! |
Awesome! I'm closing as resolved then :) |
Discussed in applejag/Newtonsoft.Json-for-Unity#137
Originally posted by jchowdown September 11, 2021
Hi, we created and configured a UnityConvertersConfig instance to not use specific custom converters when deserializing JSONs. This appears to work wonderfully in windowed mode, but when we try to run the same code in a headless editor ("-batchmode"), our converters appear to be added to the global converter list and they get run for every field that we try to deserialize. Is there something we need to do to make the editor load the ScriptableObject while in headless mode?
EDIT: I forgot to point out that this behavior is inconsistent cross machines. It works fine on my laptop but is broken (as described above) on our build machine (running Jenkins)
The text was updated successfully, but these errors were encountered: