GeneratePrefabReferences creates massive prefabs
Posted: Wed Jan 15, 2020 4:53 pm
It seems that Unity's CollectDependencies keeps adding more and more dependencies over time and this makes it so that the serialized localRefs dictionary in ES3Prefab keeps growing to the point of making massive prefab assets. It looks like it may be due to ES3PRefab's localRefs references being included in CollectDependencies which means that it keeps adding more and more references every time that GeneratePrefabReferences is called.
If tested that by clearing localRefs before calling CollectDependencies and the number of dependencies is then always the same (and of reasonable size). This would work but then that means that my prefab assets keep getting modified because the localRefs dictionary changes (even if it contains the same items, these could be in a different order).
Is there a way to ignore the localRefs references in CollectDependencies or to otherwise generate prefab references slightly differently to avoid this issue? I guess I could manually go through every property and build the localRefs that way (similar to this but without being recursive https://forum.unity.com/threads/editoru ... ch.128948/). Speaking of recursive, is localRefs meant to keep references of references or just direct references? It seems to me that it would be the latter.
Any help is appreciated!
Thanks!
- Fred
If tested that by clearing localRefs before calling CollectDependencies and the number of dependencies is then always the same (and of reasonable size). This would work but then that means that my prefab assets keep getting modified because the localRefs dictionary changes (even if it contains the same items, these could be in a different order).
Is there a way to ignore the localRefs references in CollectDependencies or to otherwise generate prefab references slightly differently to avoid this issue? I guess I could manually go through every property and build the localRefs that way (similar to this but without being recursive https://forum.unity.com/threads/editoru ... ch.128948/). Speaking of recursive, is localRefs meant to keep references of references or just direct references? It seems to me that it would be the latter.
Any help is appreciated!
Thanks!
- Fred