You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ToDynamicAsset() method uses a static dictionary via GetDeserializer() that indexes deserializers based on hashes of ScriptIDs, but then loading slightly different types with the same hash can cause an error. (For me, this happens when opening analogous AssetBundleFiles from different versions of the same program.) It appears that assets within the same version of an application don't have any overlaps in hashes, but there are collisions with different types between different versions. (See, for instance, the attached test project.) While exceptions are thrown sometimes when this happens, it may be that others fail silently.
This can be mitigated by calling GenDeserializer directly rather than using GetDeserializer (or, therefore, ToDynamicAsset), but this of course gets rid of the benefit of the cache. Rather than making this a static method (and static dictionary), would it be preferable to make it a property of the AssetBundleFile so that loading different assetbundles would not result in these errors? Another possibility would be the addition of a method to "reset" the static dictionary when necessary to load a different version that may have overlapping hashes.
ToDynamicAsset() method uses a static dictionary via GetDeserializer() that indexes deserializers based on hashes of ScriptIDs, but then loading slightly different types with the same hash can cause an error. (For me, this happens when opening analogous AssetBundleFiles from different versions of the same program.) It appears that assets within the same version of an application don't have any overlaps in hashes, but there are collisions with different types between different versions. (See, for instance, the attached test project.) While exceptions are thrown sometimes when this happens, it may be that others fail silently.
This can be mitigated by calling GenDeserializer directly rather than using GetDeserializer (or, therefore, ToDynamicAsset), but this of course gets rid of the benefit of the cache. Rather than making this a static method (and static dictionary), would it be preferable to make it a property of the AssetBundleFile so that loading different assetbundles would not result in these errors? Another possibility would be the addition of a method to "reset" the static dictionary when necessary to load a different version that may have overlapping hashes.
DynamicAssetTest.zip
The text was updated successfully, but these errors were encountered: