Skip to content

Commit a06d86e

Browse files
committed
import fix
1 parent 971cb57 commit a06d86e

5 files changed

Lines changed: 21 additions & 7 deletions

File tree

‎UnityPy/ResourceReader.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from .helpers.ImportHelper import find_all_files
3+
from .helpers import ImportHelper
44

55

66
class 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

‎UnityPy/export/SpriteHelper.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PIL import Image, ImageDraw
44

55
from .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

‎tests/samples/atlas_test‎

75 KB
Binary file not shown.

‎tests/samples/banner_1‎

33.9 KB
Binary file not shown.

‎tests/test_main.py‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@ def test_import():
66
import UnityPy
77

88
def 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+
1115
def 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

1423
def 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

0 commit comments

Comments
 (0)