K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
810 stars 123 forks source link

extract_assets() in extractor.py gives 'str' object has no attribute 'type' #145

Closed Numendacil closed 1 year ago

Numendacil commented 1 year ago

Code A snippet of the code section that cases the bug or error.

extractor.py

Error The error message that is produced by python.

'str' object has no attribute 'type'

Bug A description of what you expect to happen/see and what actually happens.

Call sorted on the dict only returns the key, to obtain the key value pairs i think .items() should be added

container = sorted(env.container.items(), key=lambda x: defaulted_export_index(x[1].type))

To Reproduce

from UnityPy.tools.extractor import extract_assets

extract_assets(src='/path/to/src', dst='/path/to/dst', use_container=True)
K0lb3 commented 1 year ago

Sorry for the late response, but it's fixed now.