This PR resolves a few problems I had exporting assets from the game Autonauts.
One assets file contains a reference to another with a relative path, which UnityPy was trying to load from the script's CWD instead of the original asset file path.
That reference doesn't match the case of the actual directory or file name.
There is another reference to library/unity default assets which, in addition to being relative and case insensitive, also doesn't exist because Library/ is apparently a magic path in Unity. Rather than calling that out explicitly here, I've opted to just silently ignore nonexistent paths/files.
I wasn't able to test on Windows, which might have a problem with the case insensitive search.
PS: I also spotted a bug in save() but can't test the fix I included here. Let me know if that's a problem and I can remove it.
This PR resolves a few problems I had exporting assets from the game Autonauts.
library/unity default assets
which, in addition to being relative and case insensitive, also doesn't exist becauseLibrary/
is apparently a magic path in Unity. Rather than calling that out explicitly here, I've opted to just silently ignore nonexistent paths/files.I wasn't able to test on Windows, which might have a problem with the case insensitive search.
PS: I also spotted a bug in
save()
but can't test the fix I included here. Let me know if that's a problem and I can remove it.