예제 #1
0
 public static ABAsyncOperationHandle <AssetBundle> LoadBundle(BundleInfo bundleInfo, ABManifest manifest)
 {
     if (manifest != null)
     {
         if (manifest.Bundles.FirstOrDefault(bundle => bundle == bundleInfo) != null)
         {
             var request   = UnityWebRequestAssetBundle.GetAssetBundle($"{manifest.RemoteLoadPath}/{bundleInfo.Name}");
             var operation = new ABAsyncOperationHandle <AssetBundle>(request, new ABDownloadHandleAssetBundle());
             return(operation);
         }
     }
     return(new ABAsyncOperationHandle <AssetBundle>());
 }
예제 #2
0
 public static ABAsyncOperationHandle <ABManifest> LoadManifest(string url)
 {
     if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
     {
         var ping = new Ping(url);
         if (ping.isDone)
         {
             var request   = UnityWebRequest.Get(url);
             var operation = new ABAsyncOperationHandle <ABManifest>(request, new ABDownloadHandlerABManifest());
             return(operation);
         }
     }
     return(new ABAsyncOperationHandle <ABManifest>());
 }