【m】完成多选打包功能
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using UnityEditor;
|
||||
@@ -46,7 +47,7 @@ namespace Stary.Evo.Editor
|
||||
[TitleGroup("Domain子包")]
|
||||
[LabelText("选择包体")]
|
||||
[ShowIf(nameof(allowMutiSelection))]
|
||||
[ValueDropdown(nameof(GetAvailablePackageNames))]
|
||||
[ValueDropdown(nameof(GetAvailablePackageNames), IsUniqueList = true)]
|
||||
public string[] selectionOfPackages;
|
||||
|
||||
[TitleGroup("Domain子包")]
|
||||
@@ -204,7 +205,7 @@ namespace Stary.Evo.Editor
|
||||
/// 开始打包流程
|
||||
/// </summary>
|
||||
/// <param name="isWatermark">是否为水印包</param>
|
||||
private void StartBuild(PLayerMode playMode)
|
||||
private async void StartBuild(PLayerMode playMode)
|
||||
{
|
||||
if (_isBuilding)
|
||||
{
|
||||
@@ -219,8 +220,34 @@ namespace Stary.Evo.Editor
|
||||
|
||||
try
|
||||
{
|
||||
// 执行打包
|
||||
BuildAndroid(playMode);
|
||||
// 多选打包
|
||||
if (allowMutiSelection)
|
||||
{
|
||||
// 已选包体列表排空
|
||||
if (selectionOfPackages.Length == 0)
|
||||
{
|
||||
throw new( "选择了多选打包,但是没有选择任何Domain子包");
|
||||
}
|
||||
|
||||
var current = 0;
|
||||
while (current < selectionOfPackages.Length)
|
||||
{
|
||||
// 获取包体ID
|
||||
var packageID = selectionOfPackages[current];
|
||||
Debug.Log($"正在打包:{packageID}");
|
||||
// 获取包体配置
|
||||
selectedPackageInfo = HotfixMainResDomain.Get.buildConfig.Get(packageID).info;
|
||||
// 打包
|
||||
await BuildAndroid(playMode);
|
||||
|
||||
current++;
|
||||
}
|
||||
}
|
||||
// 单选打包
|
||||
else
|
||||
{
|
||||
_ = BuildAndroid(playMode);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -239,7 +266,7 @@ namespace Stary.Evo.Editor
|
||||
/// <summary>
|
||||
/// Android打包核心逻辑
|
||||
/// </summary>
|
||||
private void BuildAndroid(PLayerMode pLayerMode)
|
||||
private async UniTask BuildAndroid(PLayerMode pLayerMode)
|
||||
{
|
||||
buildStatus = "加载配置文件...";
|
||||
Repaint();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.staryevo.tools",
|
||||
"version": "1.3.31",
|
||||
"version": "1.3.32",
|
||||
"displayName": "00.StaryEvo.Tools",
|
||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||
"unity": "2021.3",
|
||||
|
||||
Reference in New Issue
Block a user