public Callback <AssetBundle[], int> LoadUI(string module) { string bytesAbPath = AssetFileBook.GetUIPath(string.Format("{0}_fgui", module)); string textureAbPath = AssetFileBook.GetUIPath(string.Format("{0}_altas", module)); var callback = Callback <AssetBundle[], int> .GetOrNew(); AssetLoaderManager.GetInstance().LoadAssetSync <AssetBundle>(bytesAbPath, (bytesAb) => { AssetLoaderManager.GetInstance().LoadAssetSync <AssetBundle>(textureAbPath, (altasAb) => { callback?.onSuccess?.Invoke(new AssetBundle[] { bytesAb, altasAb }); }, (altasBytes) => { if (bytesAb != null) { callback?.onSuccess?.Invoke(new AssetBundle[] { bytesAb, null }); } else { callback?.onFailed?.Invoke(altasBytes); } }); }, (reasonBytes) => { callback?.onFailed?.Invoke(reasonBytes); }); return(callback); }
public AssetBundle[] LoadUISync(string module) { string bytesAbPath = AssetFileBook.GetUIPath(string.Format("{0}_fgui", module)); string textureAbPath = AssetFileBook.GetUIPath(string.Format("{0}_altas", module)); var bytesAb = AssetBundle.LoadFromFile(bytesAbPath); var altasAb = AssetBundle.LoadFromFile(textureAbPath); return(new AssetBundle[] { bytesAb, altasAb }); }
public Callback <GameObject, int> LoadSprite(string uid) { string assetPath = AssetFileBook.GetSpritePath(uid); var callback = Callback <GameObject, int> .GetOrNew(); AssetLoaderManager.GetInstance().LoadAssetAsync <GameObject>(assetPath, (obj) => { callback.onSuccess?.Invoke(obj); }, (reason) => { callback.onFailed?.Invoke(reason); }); return(callback); }
public string LoadConfig(string fileName) { string content = null; string assetPath = AssetFileBook.GetConfigPath(fileName); var callback = Callback <string, int> .GetOrNew(); AssetLoaderManager.GetInstance().LoadAssetSync <TextAsset>(assetPath, (textAsset) => { content = textAsset.text; }, (reason) => { callback.onFailed?.Invoke(reason); }); return(content); }
private void Start() { string assetPath = AssetFileBook.GetBundleMainfest(); AssetLoaderManager.GetInstance().LoadBundleMainfest(assetPath); }