protected override void Init(string path) { base.Init(path); if (string.IsNullOrEmpty(path)) { CDebug.LogError("XStaticAssetLoader 空资源路径!"); } _assetFileLoader = CAssetFileLoader.Load(path, (_isOk, _obj) => { if (IsReadyDisposed) { OnFinish(null); return; } TheAsset = Object.Instantiate(_obj); OnFinish(TheAsset); if (Application.isEditor) { if (TheAsset != null) { CResourceLoadObjectDebugger.Create("StaticAsset", path, TheAsset); } } }); }
protected override void Init(string url) { base.Init(url); Path = url; AssetFileBridge = CAssetFileLoader.Load(Path, OnAssetLoaded); }
protected override void Init(string url) { base.Init(url); _assetFileBridge = CAssetFileLoader.Load(url, (isOk, asset) => { if (IsReadyDisposed) // 中途释放 { OnFinish(null); return; } if (!isOk) { OnFinish(null); CDebug.LogError("[InstanceAssetLoader]Error on assetfilebridge loaded... {0}", url); return; } try { InstanceAsset = (GameObject)GameObject.Instantiate(asset as UnityEngine.GameObject); } catch (Exception e) { CDebug.LogException(e); } if (Application.isEditor) { CResourceLoadObjectDebugger.Create("AssetCopy", url, InstanceAsset); } OnFinish(InstanceAsset); }); }
protected override void Init(string url) { base.Init(url); _assetFileBridge = CAssetFileLoader.Load(url, (isOk, asset) => { OnFinish(asset); }); }
protected override void Init(string url) { base.Init(url); AssetFileBridge = CAssetFileLoader.Load(url, (bool isOk, UnityEngine.Object obj) => { OnFinish(obj); }); }
protected override void Init(string url) { base.Init(url); _bridge = CAssetFileLoader.Load(Url, (_isOk, _obj) => { OnFinish(_obj); }); }
//仅仅是预加载,回调仅告知是否加载成功 public static CAssetFileLoader Preload(string path, System.Action <bool> callback = null) { return(CAssetFileLoader.Load(path, (isOk, asset) => { if (callback != null) { callback(isOk); } })); }
//仅仅是预加载,回调仅告知是否加载成功 public static IEnumerator CoPreload(string path, System.Action <bool> callback = null) { var w = CAssetFileLoader.Load(path, null); while (!w.IsFinished) { yield return(null); } if (callback != null) { callback(!w.IsError); // isOk? } }