Пример #1
0
        private IEnumerator WaitToLoadAll()
        {
            AssetBundleLoadMutiOperation operation = AssetBundleLoader.LoadAsync(allBundleName);

            yield return(operation);

            if (!operation.isError && operation.isDone)
            {
                for (int i = 0; i < operation.assetBundleNames.Length; i++)
                {
                    Debug.LogFormat("'{0}' 载入成功", operation.assetBundleNames[i]);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 异步加载复数AssetBundle
        /// </summary>
        /// <param name="assetBundleNames"></param>
        /// <returns></returns>
        public static AssetBundleLoadMutiOperation LoadAsync(string[] assetBundleNames)
        {
            if (!CheckInitialize())
            {
                return(null);
            }

            AssetBundleLoadMutiOperation operation = new AssetBundleLoadMutiOperation(assetBundleNames);

            m_InProgressLoadOpertaions.Add(operation);

            for (int i = 0; i < assetBundleNames.Length; i++)
            {
                DownLoadAssetBundle(assetBundleNames[i]);
            }
            return(operation);
        }