Closed timelic closed 1 year ago
There is an additional way that container paths can be designated beside the already implemented option. I wasn't aware of this point until now, so thanks for opening the issue.
The container paths, in this case, have to be fetched from an object of the ResourceManager type, which assigns the container paths for all objects within the BundleFile. Implementing this in UnityPy would be a bit more work so I won't implement it any time soon. Maybe with the next major version, I hope to release around new year.
For now, you can use the following snippet to get the container path:
env = UnityPy.load("data.unity3d")
for obj in env.objects:
if obj.type.name == 'ResourceManager':
rm = obj.read()
for key, ptr in rm.m_Container.items():
print(key, ptr)
data = ptr.read()
break
Thanks for your detailed reply, which is very helpful for my project🫡
Code A snippet of the code section that cases the bug or error.
Error No error.
Bug When I use the above code to try other Unity resource files, it can output the correct
obj.container
, but when I try thedata.unity3d
file, its outputobj.container
isNone
. I use Asset Studio to open the samedata.unity3d
file, and I can get the correctcontainer
.To Reproduce