K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Renderer data node mismatch

WolfgangKurz opened this issue · comments

Need version check and should update classes/Renderer.py file. (from 84 line)

# classes/Renderer.py
# ...

if version >= (4, 3):  # 4.3 and up
    if version[:2] == (4, 3): # 4.3
        self.m_SortingLayer = reader.read_short()
    else:
        self.m_SortingLayerID = reader.read_u_int()

    if version[:2] > (2017, 4):  # Need version check!
        self.m_SortingLayer = reader.read_short()

    # SInt16 m_SortingLayer 5.6 and up
    self.m_SortingOrder = reader.read_short()
    reader.align_stream()

# ...

image
See bottom of image. m_SortingLayer and m_SortingLayerID both exists.

My earliest file version is "2017.4.39f1", and it contains that node.

I'm using that code right now to use SortingOrder correctly, please check and fix it!

Thanks for mentioning the issue,
I will fix it in some time (among probably some other version related issues for other object classes).