Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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 });
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        private void Start()
        {
            string assetPath = AssetFileBook.GetBundleMainfest();

            AssetLoaderManager.GetInstance().LoadBundleMainfest(assetPath);
        }