Fix main thread stuck on texture missing.

This commit is contained in:
2023-02-19 22:13:18 +08:00
parent 99b4c2dfc1
commit 887837bb3d

View File

@@ -175,6 +175,7 @@ namespace Cryville.Crtr {
string url = texLoader.url; string url = texLoader.url;
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1)); string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
#if UNITY_5_4_OR_NEWER #if UNITY_5_4_OR_NEWER
if (texLoader.isDone) {
if (texHandler.isDone) { if (texHandler.isDone) {
var tex = texHandler.texture; var tex = texHandler.texture;
tex.wrapMode = TextureWrapMode.Clamp; tex.wrapMode = TextureWrapMode.Clamp;
@@ -185,6 +186,10 @@ namespace Cryville.Crtr {
frames.Add(name, new SpriteFrame(tex)); frames.Add(name, new SpriteFrame(tex));
} }
texs.Add(name, tex); texs.Add(name, tex);
}
else {
Logger.Log("main", 4, "Load/Prehandle", "Unable to load texture: {0}", name);
}
texLoader.Dispose(); texLoader.Dispose();
texHandler.Dispose(); texHandler.Dispose();
texLoader = null; texLoader = null;