forked from K0lb3/UnityPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObject.py
More file actions
26 lines (23 loc) · 771 Bytes
/
GameObject.py
File metadata and controls
26 lines (23 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from .EditorExtension import EditorExtension
from .PPtr import PPtr
class GameObject(EditorExtension):
"""
public PPtr<Component>[] m_Components;
public string m_Name;
public Transform m_Transform;
public MeshRenderer m_MeshRenderer;
public MeshFilter m_MeshFilter;
public SkinnedMeshRenderer m_SkinnedMeshRenderer;
public Animator m_Animator;
public Animation m_Animation;
"""
def __init__(self, reader):
super().__init__(reader=reader)
component_size = reader.read_int()
self.components = []
for i in range(component_size):
if self.version[0] < 5 or (self.version[0] == 5 and self.version[1] < 5):
first = reader.read_int()
self.components.append(PPtr(reader))
self.layer = reader.read_int()
self.name = reader.read_aligned_string()