1
This commit is contained in:
parent
74d1909190
commit
70e7a2b50e
@ -1,98 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using AlicizaX.Editor;
|
||||
using AlicizaX;
|
||||
using AlicizaX.Debugger.Runtime;
|
||||
using AlicizaX.Framework.Runtime.ABase;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public static class AppBuildHelper
|
||||
{
|
||||
public static void GeneratAppBuilderSetting(string language, DebuggerActiveWindowType debugMode, int resMode)
|
||||
{
|
||||
const string AppBuilderSettingPath = "Assets/Resources/ModuleDynamicBindInfo.bytes";
|
||||
ModuleDynamicBindInfo appBuilderSetting = new ModuleDynamicBindInfo();
|
||||
appBuilderSetting.Language = language;
|
||||
appBuilderSetting.DebuggerActiveWindowType = debugMode;
|
||||
appBuilderSetting.ResMode = resMode;
|
||||
File.WriteAllText(AppBuilderSettingPath, Utility.Json.ToJson(appBuilderSetting));
|
||||
}
|
||||
|
||||
public static void BuildApplication(AppBuildParameter appBuildParameter, bool showExplorer = false)
|
||||
{
|
||||
if (!Directory.Exists(appBuildParameter.OutPutPath))
|
||||
{
|
||||
Directory.CreateDirectory(appBuildParameter.OutPutPath);
|
||||
}
|
||||
|
||||
Debug.Log("Starting build application");
|
||||
|
||||
GeneratAppBuilderSetting(appBuildParameter.Language, appBuildParameter.ShowDebugWnd, appBuildParameter.ResMode);
|
||||
|
||||
Debug.Log("Generate AppBuilderSetting.bytes");
|
||||
|
||||
PlayerSettings.fullScreenMode = appBuildParameter.FullScreenMode;
|
||||
if (appBuildParameter.FullScreenMode == FullScreenMode.Windowed)
|
||||
{
|
||||
PlayerSettings.defaultScreenWidth = appBuildParameter.WindowedScreenSize.x;
|
||||
PlayerSettings.defaultScreenHeight = appBuildParameter.WindowedScreenSize.y;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(appBuildParameter.Version))
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var options = new BuildPlayerOptions
|
||||
{
|
||||
scenes = appBuildParameter.Scenes,
|
||||
locationPathName = Path.Combine(appBuildParameter.OutPutPath, appBuildParameter.FileName),
|
||||
target = appBuildParameter.BuildTarget,
|
||||
options = appBuildParameter.DevelopBuild ? BuildOptions.Development : BuildOptions.None
|
||||
};
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(options);
|
||||
HandleBuildReport(report);
|
||||
if (showExplorer)
|
||||
{
|
||||
DirectoryInfo directoryInfo = Directory.GetParent(report.summary.outputPath);
|
||||
if (directoryInfo != null) OpenFolder.Execute(directoryInfo.FullName);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log($"构建过程中发生异常: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleBuildReport(UnityEditor.Build.Reporting.BuildReport report)
|
||||
{
|
||||
if (report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
||||
{
|
||||
Debug.Log($"整包构建完成:${report.summary.outputPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
Debug.LogError(report.SummarizeErrors());
|
||||
#else
|
||||
var errors = new List<string>();
|
||||
foreach (var step in report.steps)
|
||||
{
|
||||
foreach (var msg in step.messages)
|
||||
{
|
||||
if (msg.type == LogType.Error || msg.type == LogType.Exception)
|
||||
{
|
||||
errors.Add($"[Step: {step.name}] {msg.content}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Debug.LogError($"构建失败,错误信息:\n{string.Join("\n", errors)}");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Client/Assets/Editor/BuildCLI/AppBuilder.meta
Normal file
3
Client/Assets/Editor/BuildCLI/AppBuilder.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff4f89539ba94b33b8f788557078868c
|
||||
timeCreated: 1763431294
|
||||
216
Client/Assets/Editor/BuildCLI/AppBuilder/AppBuildHelper.cs
Normal file
216
Client/Assets/Editor/BuildCLI/AppBuilder/AppBuildHelper.cs
Normal file
@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using AlicizaX;
|
||||
using AlicizaX.Debugger.Runtime;
|
||||
using AlicizaX.Editor;
|
||||
using AlicizaX.Framework.Runtime.ABase;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public static class AppBuildHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 构建 Android 应用
|
||||
/// </summary>
|
||||
public static void BuildAndroid(AndroidBuildParameters androidParams, bool showExplorer = false)
|
||||
{
|
||||
if (!PreBuildCheck(androidParams))
|
||||
{
|
||||
Debug.LogError("Android 构建前检查失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置 Android 特定参数
|
||||
ApplyAndroidSpecificSettings(androidParams);
|
||||
|
||||
// 执行通用构建流程
|
||||
BuildApplication(androidParams, showExplorer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建 Standalone 应用 (Windows/Mac/Linux)
|
||||
/// </summary>
|
||||
public static void BuildStandalone(StandaloneBuildParameters standaloneParams, bool showExplorer = false)
|
||||
{
|
||||
if (!PreBuildCheck(standaloneParams))
|
||||
{
|
||||
Debug.LogError("Standalone 构建前检查失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置 Standalone 特定参数
|
||||
ApplyStandaloneSpecificSettings(standaloneParams);
|
||||
|
||||
// 执行通用构建流程
|
||||
BuildApplication(standaloneParams, showExplorer);
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private static void BuildApplication(IBuildParameters buildParams, bool showExplorer = false)
|
||||
{
|
||||
if (!Directory.Exists(buildParams.OutPutPath))
|
||||
{
|
||||
Directory.CreateDirectory(buildParams.OutPutPath);
|
||||
}
|
||||
|
||||
PlayerSettings.bundleVersion = buildParams.Version;
|
||||
Debug.Log($"开始构建应用 - 目标平台: {buildParams.BuildTarget}");
|
||||
|
||||
// 生成应用设置
|
||||
GeneratAppBuilderSetting(buildParams);
|
||||
Debug.Log("生成 AppBuilderSetting.bytes 完成");
|
||||
|
||||
try
|
||||
{
|
||||
var options = new BuildPlayerOptions
|
||||
{
|
||||
scenes = buildParams.Scenes,
|
||||
locationPathName = Path.Combine(buildParams.OutPutPath, buildParams.FileName),
|
||||
target = buildParams.BuildTarget,
|
||||
options = buildParams.DevelopBuild ? BuildOptions.Development : BuildOptions.None
|
||||
};
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(options);
|
||||
HandleBuildReport(report);
|
||||
|
||||
if (showExplorer && report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
||||
{
|
||||
DirectoryInfo directoryInfo = Directory.GetParent(report.summary.outputPath);
|
||||
if (directoryInfo != null)
|
||||
OpenFolder.Execute(directoryInfo.FullName);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"构建过程中发生异常: {e.Message}\n{e.StackTrace}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteBuilderSettingInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyAndroidSpecificSettings(AndroidBuildParameters androidParams)
|
||||
{
|
||||
// 设置 Android 平台特定的 PlayerSettings
|
||||
PlayerSettings.defaultInterfaceOrientation = UIOrientation.LandscapeLeft;
|
||||
PlayerSettings.Android.minSdkVersion = androidParams.MinSdkVersion;
|
||||
PlayerSettings.Android.targetSdkVersion = androidParams.TargetSdkVersion;
|
||||
|
||||
if (!string.IsNullOrEmpty(androidParams.BundleIdentifier))
|
||||
{
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, androidParams.BundleIdentifier);
|
||||
}
|
||||
|
||||
PlayerSettings.Android.bundleVersionCode = androidParams.BundleVersionCode;
|
||||
|
||||
// 设置纹理压缩格式
|
||||
EditorUserBuildSettings.androidBuildSubtarget = androidParams.TextureCompression;
|
||||
|
||||
Debug.Log($"Android 特定设置应用完成 - MinSDK: {androidParams.MinSdkVersion}, Bundle: {androidParams.BundleIdentifier}");
|
||||
}
|
||||
|
||||
private static void ApplyStandaloneSpecificSettings(StandaloneBuildParameters standaloneParams)
|
||||
{
|
||||
// 设置 Standalone 平台特定的 PlayerSettings
|
||||
PlayerSettings.fullScreenMode = standaloneParams.FullScreenMode;
|
||||
|
||||
if (standaloneParams.FullScreenMode == FullScreenMode.Windowed)
|
||||
{
|
||||
PlayerSettings.defaultScreenWidth = standaloneParams.DefaultScreenWidth;
|
||||
PlayerSettings.defaultScreenHeight = standaloneParams.DefaultScreenHeight;
|
||||
}
|
||||
|
||||
PlayerSettings.runInBackground = standaloneParams.RunInBackground;
|
||||
|
||||
Debug.Log($"Standalone 特定设置应用完成 - 分辨率: {standaloneParams.DefaultScreenWidth}x{standaloneParams.DefaultScreenHeight}, 全屏: {standaloneParams.FullScreenMode}");
|
||||
}
|
||||
|
||||
private static bool PreBuildCheck(IBuildParameters buildParams)
|
||||
{
|
||||
// 检查场景
|
||||
if (buildParams.Scenes == null || buildParams.Scenes.Length == 0)
|
||||
{
|
||||
Debug.LogError("构建场景列表为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (string scenePath in buildParams.Scenes)
|
||||
{
|
||||
if (!File.Exists(scenePath))
|
||||
{
|
||||
Debug.LogError($"场景文件不存在: {scenePath}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查输出路径
|
||||
if (string.IsNullOrEmpty(buildParams.OutPutPath))
|
||||
{
|
||||
Debug.LogError("输出路径为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查文件名
|
||||
if (string.IsNullOrEmpty(buildParams.FileName))
|
||||
{
|
||||
Debug.LogError("文件名为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static void GeneratAppBuilderSetting(IBuildParameters buildParameters)
|
||||
{
|
||||
const string AppBuilderSettingPath = "Assets/Resources/ModuleDynamicBindInfo.bytes";
|
||||
ModuleDynamicBindInfo appBuilderSetting = new ModuleDynamicBindInfo();
|
||||
appBuilderSetting.Language = buildParameters.Language;
|
||||
appBuilderSetting.DebuggerActiveWindowType = buildParameters.ShowDebugWnd;
|
||||
appBuilderSetting.ResMode = buildParameters.ResMode;
|
||||
appBuilderSetting.DecryptionServices = buildParameters.DecryptionServices;
|
||||
File.WriteAllText(AppBuilderSettingPath, Utility.Json.ToJson(appBuilderSetting));
|
||||
}
|
||||
|
||||
public static void DeleteBuilderSettingInfo()
|
||||
{
|
||||
const string AppBuilderSettingPath = "Assets/Resources/ModuleDynamicBindInfo.bytes";
|
||||
if (File.Exists(AppBuilderSettingPath))
|
||||
{
|
||||
File.Delete(AppBuilderSettingPath);
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleBuildReport(UnityEditor.Build.Reporting.BuildReport report)
|
||||
{
|
||||
if (report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
||||
{
|
||||
Debug.Log($"构建完成: {report.summary.outputPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
Debug.LogError(report.SummarizeErrors());
|
||||
#else
|
||||
var errors = new List<string>();
|
||||
foreach (var step in report.steps)
|
||||
{
|
||||
foreach (var msg in step.messages)
|
||||
{
|
||||
if (msg.type == LogType.Error || msg.type == LogType.Exception)
|
||||
{
|
||||
errors.Add($"[Step: {step.name}] {msg.content}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.LogError($"构建失败,错误信息:\n{string.Join("\n", errors)}");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
using AlicizaX.Debugger.Runtime;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public interface IBuildParameters
|
||||
{
|
||||
BuildTarget BuildTarget { get; }
|
||||
string OutPutPath { get; set; }
|
||||
DebuggerActiveWindowType ShowDebugWnd { get; set; }
|
||||
bool DevelopBuild { get; set; }
|
||||
int ResMode { get; set; }
|
||||
string FileName { get; set; }
|
||||
string Language { get; set; }
|
||||
string[] Scenes { get; set; }
|
||||
string Version { get; set; }
|
||||
|
||||
string DecryptionServices { get; set; }
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class AndroidBuildParameters : IBuildParameters
|
||||
{
|
||||
// 通用参数
|
||||
public BuildTarget BuildTarget => BuildTarget.Android;
|
||||
public string OutPutPath { get; set; }
|
||||
public DebuggerActiveWindowType ShowDebugWnd { get; set; }
|
||||
public bool DevelopBuild { get; set; }
|
||||
public int ResMode { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string[] Scenes { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string DecryptionServices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纹理压缩格式
|
||||
/// </summary>
|
||||
public MobileTextureSubtarget TextureCompression { get; set; } = MobileTextureSubtarget.ASTC;
|
||||
|
||||
/// <summary>
|
||||
/// 最低支持的 Android API 等级
|
||||
/// </summary>
|
||||
public AndroidSdkVersions MinSdkVersion { get; set; } = AndroidSdkVersions.AndroidApiLevel22;
|
||||
|
||||
/// <summary>
|
||||
/// 目标 API 等级
|
||||
/// </summary>
|
||||
public AndroidSdkVersions TargetSdkVersion { get; set; } = AndroidSdkVersions.AndroidApiLevelAuto;
|
||||
|
||||
/// <summary>
|
||||
/// 应用标识符
|
||||
/// </summary>
|
||||
public string BundleIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本代码
|
||||
/// </summary>
|
||||
public int BundleVersionCode { get; set; } = 1;
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class StandaloneBuildParameters : IBuildParameters
|
||||
{
|
||||
// 通用参数
|
||||
public BuildTarget BuildTarget => BuildTarget.StandaloneWindows64;
|
||||
public string OutPutPath { get; set; }
|
||||
public DebuggerActiveWindowType ShowDebugWnd { get; set; }
|
||||
public bool DevelopBuild { get; set; }
|
||||
public int ResMode { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string[] Scenes { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string DecryptionServices { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否全屏
|
||||
/// </summary>
|
||||
public FullScreenMode FullScreenMode { get; set; } = FullScreenMode.FullScreenWindow;
|
||||
|
||||
/// <summary>
|
||||
/// 默认屏幕宽度 (窗口模式有效)
|
||||
/// </summary>
|
||||
public int DefaultScreenWidth { get; set; } = 1280;
|
||||
|
||||
/// <summary>
|
||||
/// 默认屏幕高度 (窗口模式有效)
|
||||
/// </summary>
|
||||
public int DefaultScreenHeight { get; set; } = 720;
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许后台运行
|
||||
/// </summary>
|
||||
public bool RunInBackground { get; set; } = true;
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a785d30737e4e44921b35ae7a7f96b9
|
||||
timeCreated: 1763431316
|
||||
3
Client/Assets/Editor/BuildCLI/ResourceBuilder.meta
Normal file
3
Client/Assets/Editor/BuildCLI/ResourceBuilder.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58b4ef0758554795848a325abea2467a
|
||||
timeCreated: 1763431355
|
||||
@ -7,35 +7,6 @@ using UnityEngine.Serialization;
|
||||
using YooAsset;
|
||||
using YooAsset.Editor;
|
||||
|
||||
|
||||
public class AppBuildParameter
|
||||
{
|
||||
public BuildTarget BuildTarget;
|
||||
public string OutPutPath;
|
||||
public DebuggerActiveWindowType ShowDebugWnd;
|
||||
public bool DevelopBuild;
|
||||
public int ResMode;
|
||||
public string FileName;
|
||||
public string Language;
|
||||
public string[] Scenes;
|
||||
|
||||
/// <summary>
|
||||
/// 版本
|
||||
/// </summary>
|
||||
public string Version;
|
||||
|
||||
/// <summary>
|
||||
/// 是否全屏
|
||||
/// </summary>
|
||||
public FullScreenMode FullScreenMode;
|
||||
|
||||
/// <summary>
|
||||
/// 窗口化大小
|
||||
/// </summary>
|
||||
public Vector2Int WindowedScreenSize;
|
||||
}
|
||||
|
||||
|
||||
public class ResourceBuildParameter
|
||||
{
|
||||
public BuildTarget ResourceBuildTarget;
|
||||
@ -73,7 +44,7 @@ public class ResourceBuildParameter
|
||||
/// </summary>
|
||||
public bool TrackSpriteAtlasDependencies = false;
|
||||
|
||||
public string EncryptionServiceType = "AlicizaX.Resource.Editor.FileOffsetEncryption";
|
||||
public string EncryptionServiceType;
|
||||
}
|
||||
|
||||
public enum ResourceBuildMode
|
||||
@ -1,71 +1,68 @@
|
||||
// using System.IO;
|
||||
// using AlicizaX.Editor.Extension;
|
||||
// using AlicizaX;
|
||||
// using AlicizaX.Debugger.Runtime;
|
||||
// using UnityEditor;
|
||||
// using UnityEngine;
|
||||
// using YooAsset;
|
||||
// using YooAsset.Editor;
|
||||
//
|
||||
// namespace BuildCLI
|
||||
// {
|
||||
// public static class JenkinsBuildCLI
|
||||
// {
|
||||
// static string[] scenePath = new[] { "Assets/Scenes/Main.unity" };
|
||||
//
|
||||
// [EditorToolFunction("Build/离线/EXE")]
|
||||
// public static void TestBuildExe()
|
||||
// {
|
||||
// AppBuildParameter parameter = new AppBuildParameter();
|
||||
// parameter.DevelopBuild = false;
|
||||
// parameter.ShowDebugWnd = DebuggerActiveWindowType.AlwaysOpen;
|
||||
// parameter.OutPutPath = "../Build";
|
||||
// parameter.FileName = "AlicizaX.exe";
|
||||
// parameter.Scenes = scenePath;
|
||||
// parameter.BuildTarget = BuildTarget.StandaloneWindows;
|
||||
// parameter.ResMode = (int)EPlayMode.OfflinePlayMode;
|
||||
// parameter.FullScreenMode = FullScreenMode.Windowed;
|
||||
// parameter.WindowedScreenSize = new Vector2Int(1280, 720);
|
||||
// parameter.Language = "ChineseSimplified";
|
||||
// AppBuildHelper.BuildApplication(parameter);
|
||||
// }
|
||||
//
|
||||
// [EditorToolFunction("Build/离线/AB")]
|
||||
// public static void BuildOfflineRes()
|
||||
// {
|
||||
// ResourceBuildParameter buildParameter = new ResourceBuildParameter();
|
||||
// buildParameter.ResourceBuildTarget = BuildTarget.StandaloneWindows;
|
||||
// buildParameter.UseDefaultPackageVersion = true;
|
||||
// buildParameter.OutputPath = "../Bundle";
|
||||
// buildParameter.BuildMode = ResourceBuildMode.Offline;
|
||||
// ResourceBuildHelper.BuildResourcePackage(buildParameter);
|
||||
// }
|
||||
//
|
||||
// [EditorToolFunction("Build/在线/EXE")]
|
||||
// public static void TestBuildOnlineExe()
|
||||
// {
|
||||
// AppBuildParameter parameter = new AppBuildParameter();
|
||||
// parameter.DevelopBuild = false;
|
||||
// parameter.ShowDebugWnd = DebuggerActiveWindowType.AlwaysOpen;
|
||||
// parameter.OutPutPath = "../Build";
|
||||
// parameter.FileName = "SAOK.exe";
|
||||
// parameter.Scenes = scenePath;
|
||||
// parameter.BuildTarget = BuildTarget.StandaloneWindows;
|
||||
// parameter.ResMode = (int)EPlayMode.HostPlayMode;
|
||||
// parameter.Language = "ChineseSimplified";
|
||||
// AppBuildHelper.BuildApplication(parameter);
|
||||
// }
|
||||
//
|
||||
// [EditorToolFunction("Build/在线/AB")]
|
||||
// public static void TestBuildRes()
|
||||
// {
|
||||
// ResourceBuildParameter buildParameter = new ResourceBuildParameter();
|
||||
// buildParameter.ResourceBuildTarget = BuildTarget.StandaloneWindows;
|
||||
// buildParameter.UseDefaultPackageVersion = true;
|
||||
// buildParameter.OutputPath = "../Bundle";
|
||||
// buildParameter.BuildMode = ResourceBuildMode.Online;
|
||||
// buildParameter.EncryptionServiceType = string.Empty;
|
||||
// ResourceBuildHelper.BuildResourcePackage(buildParameter);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
using System.IO;
|
||||
using AlicizaX.Editor.Extension;
|
||||
using AlicizaX;
|
||||
using AlicizaX.Debugger.Runtime;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
using YooAsset.Editor;
|
||||
|
||||
namespace BuildCLI
|
||||
{
|
||||
public static class JenkinsBuildCLI
|
||||
{
|
||||
static string[] scenePath = new[] { "Assets/Scenes/Main.unity" };
|
||||
|
||||
[EditorToolFunction("Build/离线/EXE")]
|
||||
public static void TestBuildExe()
|
||||
{
|
||||
StandaloneBuildParameters parameter = new StandaloneBuildParameters();
|
||||
parameter.DevelopBuild = false;
|
||||
parameter.ShowDebugWnd = DebuggerActiveWindowType.AlwaysOpen;
|
||||
parameter.OutPutPath = "../Build";
|
||||
parameter.FileName = "AlicizaX.exe";
|
||||
parameter.Scenes = scenePath;
|
||||
parameter.ResMode = (int)EPlayMode.OfflinePlayMode;
|
||||
parameter.FullScreenMode = FullScreenMode.Windowed;
|
||||
parameter.Language = "ChineseSimplified";
|
||||
AppBuildHelper.BuildStandalone(parameter);
|
||||
}
|
||||
|
||||
[EditorToolFunction("Build/离线/AB")]
|
||||
public static void BuildOfflineRes()
|
||||
{
|
||||
ResourceBuildParameter buildParameter = new ResourceBuildParameter();
|
||||
buildParameter.ResourceBuildTarget = BuildTarget.StandaloneWindows;
|
||||
buildParameter.UseDefaultPackageVersion = true;
|
||||
buildParameter.OutputPath = "../Bundle";
|
||||
buildParameter.BuildMode = ResourceBuildMode.Offline;
|
||||
ResourceBuildHelper.BuildResourcePackage(buildParameter);
|
||||
}
|
||||
|
||||
[EditorToolFunction("Build/在线/EXE")]
|
||||
public static void TestBuildOnlineExe()
|
||||
{
|
||||
StandaloneBuildParameters parameter = new StandaloneBuildParameters();
|
||||
parameter.DevelopBuild = false;
|
||||
parameter.ShowDebugWnd = DebuggerActiveWindowType.AlwaysOpen;
|
||||
parameter.OutPutPath = "../Build";
|
||||
parameter.FileName = "SAOK.exe";
|
||||
parameter.Scenes = scenePath;
|
||||
parameter.ResMode = (int)EPlayMode.HostPlayMode;
|
||||
parameter.Language = "ChineseSimplified";
|
||||
AppBuildHelper.BuildStandalone(parameter);
|
||||
}
|
||||
|
||||
[EditorToolFunction("Build/在线/AB")]
|
||||
public static void TestBuildRes()
|
||||
{
|
||||
ResourceBuildParameter buildParameter = new ResourceBuildParameter();
|
||||
buildParameter.ResourceBuildTarget = BuildTarget.StandaloneWindows;
|
||||
buildParameter.UseDefaultPackageVersion = true;
|
||||
buildParameter.OutputPath = "../Bundle";
|
||||
buildParameter.BuildMode = ResourceBuildMode.Online;
|
||||
buildParameter.EncryptionServiceType = string.Empty;
|
||||
ResourceBuildHelper.BuildResourcePackage(buildParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
{"DebuggerActiveWindowType":0,"ResMode":3,"Language":"ChineseSimplified"}
|
||||
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35af234524048724299a40fd460cad17
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
Subproject commit f43eb7344e5b93ab631dfebccce1eba0923d41aa
|
||||
Subproject commit d729d435d24a6b60c180abccfb3576b12b1796bd
|
||||
@ -19,7 +19,7 @@ MonoBehaviour:
|
||||
width: 1920
|
||||
height: 997
|
||||
m_ShowMode: 4
|
||||
m_Title: Project
|
||||
m_Title: Inspector
|
||||
m_RootView: {fileID: 4}
|
||||
m_MinSize: {x: 875, y: 300}
|
||||
m_MaxSize: {x: 10000, y: 10000}
|
||||
@ -41,7 +41,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 349
|
||||
width: 147
|
||||
width: 290
|
||||
height: 598
|
||||
m_MinSize: {x: 51, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
@ -69,7 +69,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 147
|
||||
width: 290
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
@ -173,7 +173,7 @@ MonoBehaviour:
|
||||
m_MinSize: {x: 400, y: 100}
|
||||
m_MaxSize: {x: 32384, y: 16192}
|
||||
vertical: 0
|
||||
controlID: 145
|
||||
controlID: 25
|
||||
draggingID: 0
|
||||
--- !u!114 &8
|
||||
MonoBehaviour:
|
||||
@ -192,10 +192,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 147
|
||||
width: 290
|
||||
height: 349
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 201, y: 221}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 16}
|
||||
m_Panes:
|
||||
- {fileID: 15}
|
||||
@ -219,9 +219,9 @@ MonoBehaviour:
|
||||
- {fileID: 11}
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 147
|
||||
x: 290
|
||||
y: 0
|
||||
width: 515
|
||||
width: 323
|
||||
height: 947
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 8096, y: 16192}
|
||||
@ -245,10 +245,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 515
|
||||
width: 323
|
||||
height: 454
|
||||
m_MinSize: {x: 202, y: 221}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_MinSize: {x: 200, y: 200}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_ActualView: {fileID: 17}
|
||||
m_Panes:
|
||||
- {fileID: 17}
|
||||
@ -271,7 +271,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 454
|
||||
width: 515
|
||||
width: 323
|
||||
height: 493
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
@ -295,9 +295,9 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 662
|
||||
x: 613
|
||||
y: 0
|
||||
width: 613
|
||||
width: 594
|
||||
height: 947
|
||||
m_MinSize: {x: 232, y: 271}
|
||||
m_MaxSize: {x: 10002, y: 10021}
|
||||
@ -321,12 +321,12 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 1275
|
||||
x: 1207
|
||||
y: 0
|
||||
width: 645
|
||||
width: 713
|
||||
height: 947
|
||||
m_MinSize: {x: 275, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_MinSize: {x: 276, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 20}
|
||||
m_Panes:
|
||||
- {fileID: 20}
|
||||
@ -354,7 +354,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 422
|
||||
width: 146
|
||||
width: 289
|
||||
height: 577
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -408,10 +408,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 21
|
||||
width: 146
|
||||
width: 289
|
||||
height: 556
|
||||
m_Scale: {x: 0.07604167, y: 0.07604167}
|
||||
m_Translation: {x: 73, y: 278}
|
||||
m_Scale: {x: 0.15052083, y: 0.15052083}
|
||||
m_Translation: {x: 144.5, y: 278}
|
||||
m_MarginLeft: 0
|
||||
m_MarginRight: 0
|
||||
m_MarginTop: 0
|
||||
@ -419,12 +419,12 @@ MonoBehaviour:
|
||||
m_LastShownAreaInsideMargins:
|
||||
serializedVersion: 2
|
||||
x: -960
|
||||
y: -3655.8904
|
||||
y: -1846.9204
|
||||
width: 1920
|
||||
height: 7311.781
|
||||
height: 3693.8408
|
||||
m_MinimalGUI: 1
|
||||
m_defaultScale: 0.07604167
|
||||
m_LastWindowPixelSize: {x: 146, y: 577}
|
||||
m_defaultScale: 0.15052083
|
||||
m_LastWindowPixelSize: {x: 289, y: 577}
|
||||
m_ClearInEditMode: 1
|
||||
m_NoCameraWarning: 1
|
||||
m_LowResolutionForAspectRatios: 01000000000000000000
|
||||
@ -522,7 +522,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 73
|
||||
width: 146
|
||||
width: 289
|
||||
height: 328
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -539,7 +539,7 @@ MonoBehaviour:
|
||||
collapsed: 0
|
||||
displayed: 1
|
||||
snapOffset: {x: -174, y: -26}
|
||||
snapOffsetDelta: {x: 28, y: 0}
|
||||
snapOffsetDelta: {x: 0, y: 0}
|
||||
snapCorner: 3
|
||||
id: Tool Settings
|
||||
index: 0
|
||||
@ -552,7 +552,7 @@ MonoBehaviour:
|
||||
collapsed: 0
|
||||
displayed: 1
|
||||
snapOffset: {x: -179, y: 25}
|
||||
snapOffsetDelta: {x: 33, y: 0}
|
||||
snapOffsetDelta: {x: 0, y: 0}
|
||||
snapCorner: 1
|
||||
id: unity-grid-and-snap-toolbar
|
||||
index: 1
|
||||
@ -1137,9 +1137,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 147
|
||||
x: 290
|
||||
y: 73
|
||||
width: 513
|
||||
width: 321
|
||||
height: 433
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1154,9 +1154,9 @@ MonoBehaviour:
|
||||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: f8820000
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: a4f0ffff
|
||||
m_ExpandedIDs: 24fbffff
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@ -1200,9 +1200,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 147
|
||||
x: 290
|
||||
y: 527
|
||||
width: 513
|
||||
width: 321
|
||||
height: 472
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1234,9 +1234,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 662
|
||||
x: 613
|
||||
y: 73
|
||||
width: 611
|
||||
width: 592
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
@ -1258,8 +1258,7 @@ MonoBehaviour:
|
||||
m_ShowAllHits: 0
|
||||
m_SkipHidden: 0
|
||||
m_SearchArea: 1
|
||||
m_Folders:
|
||||
- Packages/com.unity.timeline
|
||||
m_Folders: []
|
||||
m_Globs: []
|
||||
m_OriginalText:
|
||||
m_ImportLogFlags: 0
|
||||
@ -1275,7 +1274,7 @@ MonoBehaviour:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: e48c0000
|
||||
m_LastClickedID: 36068
|
||||
m_ExpandedIDs: 000000002e81000030810000328100003481000036810000388100003a8100003c8100003e81000040810000428100004481000046810000488100004a8100004c8100004e81000050810000528100005481000056810000588100005a8100005c8100005e81000060810000628100006481000066810000688100006a8100006c8100006e81000070810000728100007481000076810000788100007a8100007c8100007e81000080810000828100008481000086810000888100008a8100008c8100008e81000090810000928100009481000096810000988100009a8100009c8100009e810000a0810000a2810000a4810000a6810000a8810000aa810000ac810000ae810000b0810000b2810000b4810000b6810000b8810000ba810000bc810000be810000c0810000c2810000c4810000c6810000c8810000ca810000cc810000ce810000d0810000d2810000d4810000d6810000d8810000da810000dc810000de810000e0810000e2810000e4810000e6810000e8810000ea810000ec810000ee810000f0810000f2810000f4810000f6810000f8810000fa810000fc810000fe81000000820000028200000482000006820000088200000a8200000c8200000e82000010820000128200001482000016820000188200001a8200001c8200001e82000020820000228200002482000026820000288200002a8200002c8200002e82000030820000328200003482000036820000388200003a8200003c8200003e82000040820000428200004482000046820000488200004a8200004c8200004e82000050820000528200005482000056820000588200005a8200005c8200005e82000060820000628200006482000066820000688200006a8200006c8200006e82000070820000728200007482000076820000788200007a8200007c8200007e82000080820000828200008482000086820000888200008a8200008c8200008e82000090820000928200009482000096820000988200009a8200009c8200009e820000a0820000a2820000a4820000a6820000a8820000aa820000ac820000ae820000b0820000b2820000b4820000b6820000b8820000ba820000bc820000be820000c0820000c2820000
|
||||
m_ExpandedIDs: 00000000107f0000127f0000147f0000167f0000187f00001a7f00001c7f00001e7f0000207f0000227f0000247f0000267f0000287f00002a7f00002c7f00002e7f0000307f0000327f0000347f0000367f0000387f00003a7f00003c7f00003e7f0000407f0000427f0000447f0000467f0000487f00004a7f00004c7f00004e7f0000507f0000527f0000547f0000567f0000587f00005a7f00005c7f00005e7f0000607f0000627f0000647f0000667f0000687f00006a7f00006c7f00006e7f0000707f0000727f0000747f0000767f0000787f00007a7f00007c7f00007e7f0000807f0000827f0000847f0000867f0000887f00008a7f00008c7f00008e7f0000907f0000927f0000947f0000967f0000987f00009a7f00009c7f00009e7f0000a07f0000a27f0000a47f0000a67f0000a87f0000aa7f0000ac7f0000ae7f0000b07f0000b27f0000b47f0000b67f0000b87f0000ba7f0000bc7f0000be7f0000c07f0000c27f0000c47f0000c67f0000c87f0000ca7f0000cc7f0000ce7f0000d07f0000d27f0000d47f0000d67f0000d87f0000da7f0000dc7f0000de7f0000e07f0000e27f0000e47f0000e67f0000e87f0000ea7f0000ec7f0000ee7f0000f07f0000f27f0000f47f0000f67f0000f87f0000fa7f0000fc7f0000fe7f000000800000028000000480000006800000088000000a8000000c8000000e80000010800000128000001480000016800000188000001a8000001c8000001e80000020800000228000002480000026800000288000002a8000002c8000002e80000030800000328000003480000036800000388000003a8000003c8000003e80000040800000428000004480000046800000488000004a8000004c8000004e80000050800000528000005480000056800000588000005a8000005c8000005e80000060800000628000006480000066800000688000006a8000006c8000006e80000070800000728000007480000076800000788000007a8000007c8000007e80000080800000828000008480000086800000888000008a8000008c8000008e80000090800000928000009480000096800000988000009a8000009c8000009e800000a0800000a2800000a4800000a6800000a8800000aa800000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@ -1300,24 +1299,24 @@ MonoBehaviour:
|
||||
m_Icon: {fileID: 0}
|
||||
m_ResourceFile:
|
||||
m_AssetTreeState:
|
||||
scrollPos: {x: 0, y: 240}
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: ffffffff000000002e81000030810000328100003481000036810000388100003a8100003c8100003e81000040810000428100004481000046810000488100004a8100004c8100004e81000050810000528100005481000056810000588100005a8100005c8100005e81000060810000628100006481000066810000688100006a8100006c8100006e81000070810000728100007481000076810000788100007a8100007c8100007e81000080810000828100008481000086810000888100008a8100008c8100008e81000090810000928100009481000096810000988100009a8100009c8100009e810000a0810000a2810000a4810000a6810000a8810000aa810000ac810000ae810000b0810000b2810000b4810000b6810000b8810000ba810000bc810000be810000c0810000c2810000c4810000c6810000c8810000ca810000cc810000ce810000d0810000d2810000d4810000d6810000d8810000da810000dc810000de810000e0810000e2810000e4810000e6810000e8810000ea810000ec810000ee810000f0810000f2810000f4810000f6810000f8810000fa810000fc810000fe81000000820000028200000482000006820000088200000a8200000c8200000e82000010820000128200001482000016820000188200001a8200001c8200001e82000020820000228200002482000026820000288200002a8200002c8200002e82000030820000328200003482000036820000388200003a8200003c8200003e82000040820000428200004482000046820000488200004a8200004c8200004e82000050820000528200005482000056820000588200005a8200005c8200005e82000060820000628200006482000066820000688200006a8200006c8200006e82000070820000728200007482000076820000788200007a8200007c8200007e82000080820000828200008482000086820000888200008a8200008c8200008e82000090820000928200009482000096820000988200009a8200009c8200009e820000a0820000a2820000a4820000a6820000a8820000aa820000ac820000ae820000b0820000b2820000b4820000b6820000b8820000ba820000bc820000be820000c0820000c2820000d4820000508300005a830000ffffff7f
|
||||
m_ExpandedIDs: ffffffff00000000107f0000127f0000147f0000167f0000187f00001a7f00001c7f00001e7f0000207f0000227f0000247f0000267f0000287f00002a7f00002c7f00002e7f0000307f0000327f0000347f0000367f0000387f00003a7f00003c7f00003e7f0000407f0000427f0000447f0000467f0000487f00004a7f00004c7f00004e7f0000507f0000527f0000547f0000567f0000587f00005a7f00005c7f00005e7f0000607f0000627f0000647f0000667f0000687f00006a7f00006c7f00006e7f0000707f0000727f0000747f0000767f0000787f00007a7f00007c7f00007e7f0000807f0000827f0000847f0000867f0000887f00008a7f00008c7f00008e7f0000907f0000927f0000947f0000967f0000987f00009a7f00009c7f00009e7f0000a07f0000a27f0000a47f0000a67f0000a87f0000aa7f0000ac7f0000ae7f0000b07f0000b27f0000b47f0000b67f0000b87f0000ba7f0000bc7f0000be7f0000c07f0000c27f0000c47f0000c67f0000c87f0000ca7f0000cc7f0000ce7f0000d07f0000d27f0000d47f0000d67f0000d87f0000da7f0000dc7f0000de7f0000e07f0000e27f0000e47f0000e67f0000e87f0000ea7f0000ec7f0000ee7f0000f07f0000f27f0000f47f0000f67f0000f87f0000fa7f0000fc7f0000fe7f000000800000028000000480000006800000088000000a8000000c8000000e80000010800000128000001480000016800000188000001a8000001c8000001e80000020800000228000002480000026800000288000002a8000002c8000002e80000030800000328000003480000036800000388000003a8000003c8000003e80000040800000428000004480000046800000488000004a8000004c8000004e80000050800000528000005480000056800000588000005a8000005c8000005e800000608000006280000064800000668000006a8000006c8000006e800000708000007280000076800000788000007a8000007c8000007e80000080800000828000008480000086800000888000008a8000008c8000008e80000090800000928000009480000096800000988000009a8000009c8000009e800000a0800000a2800000a4800000a8800000aa800000ffffff7f
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
m_OriginalName:
|
||||
m_Name: FrameworkPackageManagerWindow
|
||||
m_OriginalName: FrameworkPackageManagerWindow
|
||||
m_EditFieldRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
m_UserData: 0
|
||||
m_UserData: 8296
|
||||
m_IsWaitingForDelay: 0
|
||||
m_IsRenaming: 0
|
||||
m_OriginalEventType: 11
|
||||
m_OriginalEventType: 0
|
||||
m_IsRenamingFilename: 1
|
||||
m_ClientGUIView: {fileID: 12}
|
||||
m_SearchString:
|
||||
@ -1379,9 +1378,9 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 1275
|
||||
x: 1207
|
||||
y: 73
|
||||
width: 644
|
||||
width: 712
|
||||
height: 926
|
||||
m_SerializedDataModeController:
|
||||
m_DataMode: 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user