Skip to content

Commit

Permalink
fix: Read SpriteBone correctly
Browse files Browse the repository at this point in the history
Should read rotaion in SpriteBone via read_quaternion.
(Only tested in version 2020.3.38)
  • Loading branch information
Nattsu39 authored Oct 15, 2023
1 parent 903bdad commit 5444a8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UnityPy/classes/Sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, reader):
2020,
3,
):
self.m_Bones = [SpriteBone() for _ in range(m_BonesSize)]
self.m_Bones = [SpriteBone(self.reader) for _ in range(m_BonesSize)]
else:
self.m_Bones = [reader.read_vector2_array() for _ in range(m_BonesSize)]

Expand Down Expand Up @@ -242,13 +242,13 @@ class SpriteBone:
def __init__(self, reader: EndianBinaryReader) -> None:
self.name = reader.read_aligned_string()
self.position = reader.read_vector3()
self.rotation = reader.read_vector3()
self.rotation = reader.read_quaternion()
self.length = reader.read_float()
self.parentId = reader.read_int()

def save(self, writer: EndianBinaryWriter):
writer.write_aligned_string(self.name)
writer.write_vector3(self.position)
writer.write_vector3(self.rotation)
writer.write_quaternion(self.rotation)
writer.write_float(self.length)
writer.write_int(self.parentId)

0 comments on commit 5444a8b

Please sign in to comment.