Update Utils.cs

This commit is contained in:
ALEXTANG
2022-07-06 17:22:22 +08:00
parent d220be722c
commit ae5fe1185e

View File

@@ -167,7 +167,7 @@ namespace TEngine
int splitIndex = path.LastIndexOf('#'); int splitIndex = path.LastIndexOf('#');
string resPath; string resPath;
bool bWithSubAssets; bool bWithSubAssets;
string subAssetName; string subAssetName = string.Empty;
if (splitIndex > 0) if (splitIndex > 0)
{ {
resPath = path.Substring(0, splitIndex); resPath = path.Substring(0, splitIndex);
@@ -201,10 +201,9 @@ namespace TEngine
if (bWithSubAssets) if (bWithSubAssets)
{ {
string name = path.Split('.')[0]; if (asset[subAssetName] != null)
if (asset[name] != null)
{ {
image.sprite = asset[name] as Sprite; image.sprite = asset[subAssetName] as Sprite;
} }
} }
else else