示例#1
0
        public static AssetAsyncRequest CreateBundleRequest(
            string bundleName,
            AssetBundleInfoNode assetBundleInfoNode,
            System.Action <string> bundleLoadedCallback,
            Dictionary <string, UnityEngine.Object> assetDic)
        {
            if (assetBundleInfoNode == null || string.IsNullOrEmpty(bundleName))
            {
                Debug.LogError("Create asset request failed ::: Bundle name or asset bundle is null");
                return(null);
            }

            AssetAsyncRequest request = new AssetAsyncRequest();

            request.Reset();
            request.assetRequestType    = AssetRequestType.All;
            request.bundleName          = bundleName;
            request.assetBundleInfoNode = assetBundleInfoNode;

            request.bundleLoadedCallback = bundleLoadedCallback;

            request.assetDic = assetDic;

            return(request);
        }
示例#2
0
        public static AssetAsyncRequest CreatePartRequest(
            string bundleName,
            AssetBundleInfoNode assetBundleInfoNode,
            string[] assetNameArray,
            System.Type assetType,
            System.Action <string, string[], System.Type> assetsLoadedCallbackSameType,
            Dictionary <string, UnityEngine.Object> assetDic)
        {
            if (assetBundleInfoNode == null || string.IsNullOrEmpty(bundleName))
            {
                Debug.LogError("Create asset request failed ::: Bundle name or asset bundle is null");
                return(null);
            }

            if (assetNameArray == null || assetType == null)
            {
                Debug.LogError("Create asset request failed");
                return(null);
            }

            AssetAsyncRequest request = new AssetAsyncRequest();

            request.Reset();
            request.assetRequestType    = AssetRequestType.Part_SameType;
            request.bundleName          = bundleName;
            request.assetBundleInfoNode = assetBundleInfoNode;

            request.assetNameArray = assetNameArray;
            request.assetType      = assetType;

            request.assetsLoadedCallbackSameType = assetsLoadedCallbackSameType;

            request.assetDic = assetDic;

            return(null);
        }