File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22
3- from .helpers . ImportHelper import find_all_files
3+ from .helpers import ImportHelper
44
55
66class ResourceReader :
@@ -45,7 +45,7 @@ def get_data(self):
4545 current_directory = os .path .dirname (self .assets_file .full_name )
4646 resource_file_path = os .path .join (current_directory , resource_file_name )
4747 if not os .path .isfile (resource_file_path ):
48- find_files = find_all_files (current_directory , resource_file_name )
48+ find_files = ImportHelper . find_all_files (current_directory , resource_file_name )
4949 if find_files :
5050 resource_file_path = find_files [0 ]
5151
Original file line number Diff line number Diff line change 33from PIL import Image , ImageDraw
44
55from .Texture2DConverter import get_image_from_texture2d
6- from ..streams import EndianBinaryReader
6+ from ..EndianBinaryReader import EndianBinaryReader
77
88
99# should be imported from Sprite, but too lazy to fix the import issues caused by that
Original file line number Diff line number Diff line change @@ -6,10 +6,24 @@ def test_import():
66 import UnityPy
77
88def test_read ():
9- pass
10-
9+ import UnityPy
10+ for f in os .listdir (SAMPLES ):
11+ am = UnityPy .AssetsManager (os .path .join (SAMPLES , f ))
12+ for obj in am .objects .values ():
13+ obj .read ()
14+
1115def test_texture2d ():
12- pass
16+ import UnityPy
17+ for f in os .listdir (SAMPLES ):
18+ am = UnityPy .AssetsManager (os .path .join (SAMPLES , f ))
19+ for obj in am .objects .values ():
20+ if obj .type == "Texture2D" :
21+ obj .read ().image
1322
1423def test_sprite ():
15- pass
24+ import UnityPy
25+ for f in os .listdir (SAMPLES ):
26+ am = UnityPy .AssetsManager (os .path .join (SAMPLES , f ))
27+ for obj in am .objects .values ():
28+ if obj .type == "Sprite" :
29+ obj .read ().image
You can’t perform that action at this time.
0 commit comments