-
Notifications
You must be signed in to change notification settings - Fork 1
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
Questions #1
Comments
Hi! You are correct! That is how it works :) so the Resource folder only has small scriptableobject files in it. Never actually tried arrays of weak references, that could very well be a problem. It takes longer the bigger the project gets, but it is still alright in our project with 100+ scenes 10000+ prefabs+scriptableobjects. Compared to the rest of the building its small part, but it is worth it for the flexibility of day to day work. Thanks for the questions and fun that you find it useful :) |
Thanks! For arrays, I meant if I have a scriptable object type has an array of some other type (like an item list), those would get missed. I ended up pulling this down and changing up a couple things. I added support for drilling down into array types and added a manual list of types to support instead of going over every asset. Array types is simple, DoWork middle just becomes
And I just gather the guids via a list of my supported types like so:
For my project I don't need prefab/scene support ~yet so I have no need to drill down into those two, but good to know its not a huge issue for you on a larger project. |
Sorry for formatting, not used to git's code block, and apparently I have no idea how to fix it |
Fun! You are very welcome to make a pull request with the fix :) also the change with supported typed.. come to think about it, a optional setting file with that list and toggles for where it should look (prefabs/so's/scenes) wouldn't hurt either |
yeah, there are probably better ways to support type filtering, especially for a team larger than 1 person :) My implementation is more of a quick and dirty optimization. |
This set of scripts looks very useful. I just had some questions about the implementation.
I'm following that the UnityWeakReference class will allow an object to reference a unity Object and have it convert to a path string pre-serialization of a generated UnityWeakReferenceScriptableObject object.
I would like to understand more of what EditorUnityWeakReference is doing. What it looks like it is doing is a build preprocess pass it goes over every unity object in the assets folder, iterating over properties looking for any property that extends the UnityWeakReference type (albeit ignoring arrays? It doesn't appear to drill down in DoWork) and then creates a bunch of UnityWeakReferenceScriptableObjects in the resources folder back to the real object. In this case it doesn't look like the real object would be in the resources folder, but would it still be packaged and loadable as a resource just by being referenced from an object in resources?
How bad does this preprocess step hurt build times on large projects? Iterating over every unity object in Asset/ seems like it might have scaling issues.
The text was updated successfully, but these errors were encountered: