From b7b375092fd0e39f4c7880e423693c8e253a7dd3 Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 3 Aug 2024 19:01:55 +0800 Subject: [PATCH] refactor : process build logic --- .../DefaultBuildinFileSystemBuild.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystemBuild.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystemBuild.cs index 7b1e000..f6fdfa7 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystemBuild.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystemBuild.cs @@ -15,6 +15,8 @@ namespace YooAsset /// public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) { + YooLogger.Log("Begin to create catalog file !"); + string savePath = $"Assets/Resources/{YooAssetSettingsData.Setting.DefaultYooFolderName}"; DirectoryInfo saveDirectory = new DirectoryInfo(savePath); if (saveDirectory.Exists) @@ -24,8 +26,7 @@ namespace YooAsset DirectoryInfo rootDirectory = new DirectoryInfo(rootPath); if (rootDirectory.Exists == false) { - Debug.LogWarning($"Can not found StreamingAssets root directory : {rootPath}"); - return; + throw new System.Exception($"Can not found StreamingAssets root directory : {rootPath}"); } // 搜索所有Package目录 @@ -48,8 +49,7 @@ namespace YooAsset string versionFilePath = $"{pacakgeDirectory}/{versionFileName}"; if (File.Exists(versionFilePath) == false) { - Debug.LogWarning($"Can not found package version file : {versionFilePath}"); - return; + throw new System.Exception($"Can not found package version file : {versionFilePath}"); } packageVersion = FileUtility.ReadAllText(versionFilePath); @@ -62,8 +62,7 @@ namespace YooAsset string manifestFilePath = $"{pacakgeDirectory}/{manifestFileName}"; if (File.Exists(manifestFilePath) == false) { - Debug.LogWarning($"Can not found package manifest file : {manifestFilePath}"); - return; + throw new System.Exception($"Can not found package manifest file : {manifestFilePath}"); } var binaryData = FileUtility.ReadAllBytes(manifestFilePath);