mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-17 21:30:13 +00:00
refactor : process build logic
This commit is contained in:
@@ -15,6 +15,8 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user