-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCCContentManager.patch
51 lines (45 loc) · 2.07 KB
/
CCContentManager.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/src/platform/CCContentManager.cs b/src/platform/CCContentManager.cs
index 45d7f18..efd6b7c 100644
--- a/src/platform/CCContentManager.cs
+++ b/src/platform/CCContentManager.cs
@@ -77,7 +77,7 @@ public AssetEntry(object asset, string assetFileName, bool weakReference, bool u
Dictionary<string, AssetEntry> loadedAssets;
Dictionary<string, string> assetLookupDict = new Dictionary<string, string>();
- Dictionary<string, string> failedAssets = new Dictionary<string, string>();
+ Dictionary<Tuple<string, Type>, string> failedAssets = new Dictionary<Tuple<string, Type>, string>();
List<string> searchPaths = new List<string>();
List<string> searchResolutionsOrder = new List<string>();
@@ -180,7 +180,8 @@ string GetRealName(string assetName)
public T TryLoad<T>(string assetName, bool weakReference=false)
{
- if (failedAssets.ContainsKey(assetName))
+ var assetKey = Tuple.Create(assetName, typeof(T));
+ if (failedAssets.ContainsKey(assetKey))
{
return default(T);
}
@@ -191,7 +192,7 @@ public T TryLoad<T>(string assetName, bool weakReference=false)
}
catch (Exception)
{
- failedAssets[assetName] = null;
+ failedAssets[assetKey] = null;
return default(T);
}
@@ -199,7 +200,8 @@ public T TryLoad<T>(string assetName, bool weakReference=false)
public override T Load<T>(string assetName)
{
- if (failedAssets.ContainsKey(assetName))
+ var assetKey = Tuple.Create(assetName, typeof(T));
+ if (failedAssets.ContainsKey(assetKey))
{
throw new ContentLoadException("Failed to load the asset file from " + assetName);
}
@@ -210,7 +212,7 @@ public override T Load<T>(string assetName)
}
catch (Exception)
{
- failedAssets[assetName] = null;
+ failedAssets[assetKey] = null;
throw;
}