Fix main thread stuck on texture missing.
This commit is contained in:
@@ -175,16 +175,21 @@ 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 (texHandler.isDone) {
|
if (texLoader.isDone) {
|
||||||
var tex = texHandler.texture;
|
if (texHandler.isDone) {
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
var tex = texHandler.texture;
|
||||||
if (frames.ContainsKey(name)) {
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
if (frames.ContainsKey(name)) {
|
||||||
|
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frames.Add(name, new SpriteFrame(tex));
|
||||||
|
}
|
||||||
|
texs.Add(name, tex);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
frames.Add(name, new SpriteFrame(tex));
|
Logger.Log("main", 4, "Load/Prehandle", "Unable to load texture: {0}", name);
|
||||||
}
|
}
|
||||||
texs.Add(name, tex);
|
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texHandler.Dispose();
|
texHandler.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user