private static void OnLoadAssetBundle(string cacheUrl, Action <AssetBundle> callback) { AssetBundle obj = AssetPool.GetAsset(cacheUrl) as AssetBundle; if (callback != null) { callback(obj); } }
private static void OnLoadImage(string cacheUrl, Action <Texture2D> callback) { Texture2D obj = AssetPool.GetAsset(cacheUrl) as Texture2D; if (callback != null) { callback(obj); } }
private static void OnLoadPrefab(string cacheUrl, Action <GameObject> callback) { GameObject gameObject = AssetPool.GetAsset(cacheUrl) as GameObject; GameObject obj = null; if (gameObject != null) { obj = (UnityEngine.Object.Instantiate(gameObject) as GameObject); } if (callback != null) { callback(obj); } }
public static byte[] GetLuaBytes(string name) { string key = name + ".lua"; UnityEngine.Object @object = AssetPool.GetAsset(key); if (@object != null) { return((@object as TextAsset).bytes); } @object = AssetPool.FindLuaAsset(key); if (@object != null) { return((@object as TextAsset).bytes); } return(null); }
public static UnityEngine.Object GetAsset(string url) { string cachedAssetUrl = CacheManager.GetCachedAssetUrl(url); return(AssetPool.GetAsset(cachedAssetUrl)); }