Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UnityPy/classes/generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def unitypy_define(cls: T) -> T:
which would make type-hinting more tricky, and breaks attrs.define.

Therefore this function bypasses the issue
by redifining the bases for problematic classes for the attrs.define call.
by redefining the bases for problematic classes for the attrs.define call.
"""
bases = cls.__bases__
if bases[0] in (object, Object, ABC):
Expand Down
6 changes: 4 additions & 2 deletions UnityPy/helpers/TypeTreeHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def copy(self) -> TypeTreeConfig:
return TypeTreeConfig(self.as_dict, self.assetsfile, self.has_registry)


def get_ref_type_node(ref_object: dict, assetfile: SerializedFile) -> Optional[TypeTreeNode]:
def get_ref_type_node(
ref_object: dict, assetfile: SerializedFile
) -> Optional[TypeTreeNode]:
typ = ref_object["type"]
if isinstance(typ, dict):
cls = typ["class"]
Expand Down Expand Up @@ -209,7 +211,7 @@ def read_value(
size = reader.read_int()
subtype = node.m_Children[0].m_Children[1]
if metaflag_is_aligned(subtype.m_MetaFlag):
value = read_value_array(subtype, reader, config)
value = read_value_array(subtype, reader, config, size)
else:
value = [read_value(subtype, reader, config) for _ in range(size)]

Expand Down
2 changes: 1 addition & 1 deletion generators/ClassesGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def unitypy_define(cls: T) -> T:
which would make type-hinting more tricky, and breaks attrs.define.

Therefore this function bypasses the issue
by redifining the bases for problematic classes for the attrs.define call.
by redefining the bases for problematic classes for the attrs.define call.
\"\"\"
bases = cls.__bases__
if bases[0] in (object, Object, ABC):
Expand Down