1using System.Collections.Generic;
21 public Dictionary<string, T>
dict =
new Dictionary<string, T>();
32 foreach (T value
in dict.Values)
34 Object.DestroyImmediate(value);
42 string key = typeof(T).Name + id;
43 if (!
dict.TryGetValue(key, out value))
45 value = ((loadType ==
ResourceLoadType.Streaming) ? IO.LoadObject<T>(
path +
id, option) : Resources.Load<T>(
path + id));
54 string key = typeof(T2).Name + id;
55 if (!
dict.TryGetValue(key, out value))
58 val = ((loadType != 0) ?
AssetBundle.LoadFromFile(Application.streamingAssetsPath +
"/Bundle/" +
id).LoadAsset<GameObject>(
new FileInfo(
id).Name).GetComponent<T2>() : Resources.Load<T2>(
path + id));
59 dict.Add(key, val as T);
static ResourceCache< Object > caches
static T LoadBundle< T >(string path)
static T Load< T >(string path)
ResourceCache(string _path="")
Dictionary< string, T > dict
T Get(string id, ResourceLoadType loadType=ResourceLoadType.Resource, object option=null)
T2 Get< T2 >(string id, ResourceLoadType loadType=ResourceLoadType.Resource)