Closed DavidESDR closed 3 weeks ago
RectTransform has indeed a fair bit of additional fields, as can be seen in the docs auto-generated for the stale rust port of UnityPy.
As I'm planning to move away from hard-coded parsers, to only using typetree parsing, this issue will be solved with that.
As this is still some time away, you can simply use read_typetree() for now to get all attributes safely. This works for all classes, but won't deliver a nice class, but instead only a hacky dict wrapper that behaves like a class, or alternatively, as dict.
'object.read_typetree' works great (I was already using a bunch of JSON in my project, so another string indexed dict
wouldn't hurt). Thanks!
Code Example python code and bundle (Unity 2020.3.48.1) example.zip
Error Anchors, size delta, and pivot properties are not currently being parsed. See here for a deep look into RectTransforms. The article is four years old at this point, so the way bundles are stored may have changed in newer versions of Unity.
Bug What I added to
...\UnityPy\classes\RectTransform.py
to parse the desired properties:NOTE: The Unity spec includes phantom properties called
offsetsMin
andoffsetMax
which are not actually stored in bundles. I am unsure if the properties above are the only properties, but I'm sure you have better methods of determining that than I do.To Reproduce UnityPy 1.10.14 Python 3.12.5 See example file above.