diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSLoadBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSLoadBundleOperation.cs index d4a2205..2375d15 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSLoadBundleOperation.cs @@ -36,9 +36,21 @@ namespace YooAsset { int failedTryAgain = int.MaxValue; int timeout = 60; - string mainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); - string fallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); + string mainURL; + string fallbackURL; + if (_fileSystem.AllowCrossAccess) + { + mainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); + fallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); + } + else + { + string fileLoadPath = _fileSystem.GetWebFileLoadPath(_bundle); + mainURL = DownloadSystemHelper.ConvertToWWWPath(fileLoadPath); + fallbackURL = mainURL; + } _downloadhanlderAssetBundleOp = new DownloadHandlerAssetBundleOperation(_fileSystem, _bundle, mainURL, fallbackURL, failedTryAgain, timeout); + OperationSystem.StartOperation(_fileSystem.PackageName, _downloadhanlderAssetBundleOp); } DownloadProgress = _downloadhanlderAssetBundleOp.DownloadProgress; diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSRequestPackageVersionOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSRequestPackageVersionOperation.cs index 384616a..ce396c9 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSRequestPackageVersionOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebFileSystem/Operation/DWFSRequestPackageVersionOperation.cs @@ -38,8 +38,19 @@ namespace YooAsset { string packageName = _fileSystem.PackageName; string fileName = YooAssetSettingsData.GetPackageVersionFileName(packageName); - string mainURL = _fileSystem.RemoteServices.GetRemoteMainURL(fileName); - string fallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(fileName); + string mainURL; + string fallbackURL; + if (_fileSystem.AllowCrossAccess) + { + mainURL = _fileSystem.RemoteServices.GetRemoteMainURL(fileName); + fallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(fileName); + } + else + { + string filePath = _fileSystem.GetWebPackageVersionFilePath(); + mainURL = DownloadSystemHelper.ConvertToWWWPath(filePath); + fallbackURL = mainURL; + } _getRemotePackageVersionOp = new DefaultGetRemotePackageVersionOperation(packageName, mainURL, fallbackURL, _appendTimeTicks, _timeout); OperationSystem.StartOperation(packageName, _getRemotePackageVersionOp); } diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs new file mode 100644 index 0000000..c74b477 --- /dev/null +++ b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs @@ -0,0 +1,10 @@ + +namespace YooAsset +{ + public class SimulateBuildResult + { + public string PackageVersionFilePath; + public string PackageManifestFilePath; + public string PackageHashFilePath; + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs.meta b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs.meta new file mode 100644 index 0000000..3401d32 --- /dev/null +++ b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateBuildResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d80e7b3bcadc90148a3be4fc5b41d516 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs index 713e3c6..955f724 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs @@ -3,13 +3,6 @@ using System.Reflection; namespace YooAsset { - public class SimulateBuildResult - { - public string PackageVersionFilePath; - public string PackageManifestFilePath; - public string PackageHashFilePath; - } - public static class EditorSimulateModeHelper { private static System.Type _classType; @@ -50,12 +43,12 @@ namespace YooAsset { public static class EditorSimulateModeHelper { - public static string SimulateBuild(string buildPipelineName, string packageName) + public static SimulateBuildResult SimulateBuild(string buildPipelineName, string packageName) { throw new System.Exception("Only support in unity editor !"); } - public static string SimulateBuild(EDefaultBuildPipeline buildPipeline, string packageName) + public static SimulateBuildResult SimulateBuild(EDefaultBuildPipeline buildPipeline, string packageName) { throw new System.Exception("Only support in unity editor !"); }