#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceLocations;
using UnityEngine.ResourceManagement.Util;
namespace UnityEngine.ResourceManagement.ResourceProviders.Simulation
{
///
/// Custom version of AssetBundleRequestOptions used to compute needed download size while bypassing the cache. In the future a virtual cache may be implemented.
///
[Serializable]
public class VirtualAssetBundleRequestOptions : AssetBundleRequestOptions
{
///
public override long ComputeSize(IResourceLocation location, ResourceManager resourceManager)
{
var id = resourceManager == null ? location.InternalId : resourceManager.TransformInternalId(location);
if (!ResourceManagerConfig.IsPathRemote(id))
return 0;
return BundleSize;
}
}
///
/// Provides assets from virtual asset bundles. Actual loads are done through the AssetDatabase API.
///
[DisplayName("Assets from Virtual Bundles")]
public class VirtualBundledAssetProvider : ResourceProviderBase
{
///
/// Default copnstructor.
///
public VirtualBundledAssetProvider()
{
m_ProviderId = typeof(BundledAssetProvider).FullName;
}
class InternalOp
{
VBAsyncOperation