【m】增加web第一版暂存
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 10s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 32s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (07.RKTools) (push) Successful in 3s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s

This commit is contained in:
2026-04-18 01:00:51 +08:00
parent ef5113afc6
commit 60f1264d51
20 changed files with 227 additions and 200 deletions

View File

@@ -13,8 +13,14 @@ namespace Stary.Evo.Editor
{
public void OnEnable()
{
#if UNITY_WEBGL
viewer = new ScriptableBuildPipelineViewer(packageName, selectedBuildPipelines.ToString(),
packageVersion);
#else
viewer = new MixedBuildPipelineViewer(packageName, selectedBuildPipelines.ToString(),
packageVersion);
#endif
oldVersionX = packageVersionX;
oldVersionY = packageVersionY;
oldVersionZ = packageVersionZ;

View File

@@ -11,10 +11,8 @@ using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
#if HotUpdate
using HybridCLR.Editor;
using HybridCLR.Editor.Commands;
#endif
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Sirenix.OdinInspector;
@@ -34,13 +32,6 @@ namespace Stary.Evo.Editor
[MenuItem("Evo/Dev/资源打包工具", false, 2)]
static void ShowWindows()
{
#if NotUpdate
if (EditorUtility.DisplayDialog("提示", "当前为非热更模式,不支持热更打包功能,是否切换热更模式", "是", "否"))
{
ChangeHotUpdateSchema.SetHotUpdateMode(HotUpdateMode.HotUpdate);
}
#elif HotUpdate
if (CreatAssetWindow.GetCreatDomainAll().Count <= 0)
{
EditorUtility.DisplayDialog("提示", "不存在Domain元素无法打开此面板请先创建Domain元素", "确定");
@@ -49,7 +40,6 @@ namespace Stary.Evo.Editor
window = (BuildAssetWindow)EditorWindow.GetWindow(typeof(BuildAssetWindow));
window.Show();
#endif
}
protected override void OnDisable()
@@ -95,17 +85,17 @@ namespace Stary.Evo.Editor
#region HyBridCLRBuild
#if !UNITY_WEBGL
[BoxGroup("Build", showLabel: false)]
[Title("打包dll(子包仅打一次)", titleAlignment: TitleAlignments.Centered)]
[HorizontalGroup("Build/HyBridClrBuildEntity"), HideLabel]
public BuildAssetEntity hyBridClrBuildEntity =
new BuildAssetEntity("HyBridCLRBuild", "DllBuildTarget", () =>
{
#if HotUpdate
//PrebuildCommand.GenerateAll();
CompileDllCommand.CompileDllActiveBuildTarget();
#endif
});
#endif
#endregion
@@ -230,8 +220,19 @@ namespace Stary.Evo.Editor
$"开始上传至服务器[{selectedPackageNames}],,版本号为[{BuildAssetDataSetting.packageVersion}", "Yes", "No"))
{
// 新增打包为zip的逻辑
List<string> fileList = new List<string>();
#if UNITY_WEBGL
var outputPackageDirectory =
$"{AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()}/{EditorUserBuildSettings.activeBuildTarget}/{selectedPackageNames}";
//拷贝目录
string outFilePath = $"{outputPackageDirectory}/{BuildAssetDataSetting.packageVersion}";
FilesUtils.GetFiles(outFilePath, ref fileList);
#else
string zipFilePath = BuildZip(BuildAssetDataSetting);
await UpdateFileDataResDomain(BuildAssetDataSetting, zipFilePath);
fileList.Add(zipFilePath);
#endif
await UpdateFileDataResDomain(BuildAssetDataSetting, fileList.ToArray());
await Task.Delay(1000);
EditorUtility.ClearProgressBar();
}
@@ -355,10 +356,23 @@ namespace Stary.Evo.Editor
File.Copy(sourcePath, destinationPath);
}
public static async Task UpdateFileDataResDomain(BuildAssetDataSetting setting, string zipFilePath)
public static async Task UpdateFileDataResDomain(BuildAssetDataSetting setting, string[] zipFiles)
{
string ip = CustomEditorPrefs.GetString("ip");
var messageEntity = await WebRequestSystem.PostFile(ip + "/FileLoad/UpLoadFile", new[] { zipFilePath });
Dictionary<string, string> headers = null;
#if UNITY_WEBGL
headers = new Dictionary<string, string>()
{
{ "folderName", setting.packageName },
{ "folderVersion", setting.packageVersion },
};
#endif
var messageEntity = await WebRequestSystem.PostFile(ip + "/FileLoad/UpLoadFile", zipFiles, headers);
EditorUtility.DisplayProgressBar("提示", $"开始上传{setting.packageName}(上传zip文件)", 0.5f);
if (messageEntity.code == 200)
{

View File

@@ -1,76 +0,0 @@
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Stary.Evo.Editor
{
public class ChangeHotUpdateSchema
{
public static HotUpdateMode HotUpdateMode
{
get => _hotUpdate;
set => SetHotUpdateMode(value);
}
private static HotUpdateMode _hotUpdate;
private const string EditorNotUpdateMode = "Evo/Schema/ChangeHotUpdate/NOTUPDARE(非热更模式)";
private const string EditorHotUpdateMode = "Evo/Schema/ChangeHotUpdate/HOTUPDATE(热更模式)";
[MenuItem(EditorNotUpdateMode)]
private static void SetNotUpdateMode() => SetHotUpdateMode(HotUpdateMode.NotUpdate);
[MenuItem(EditorHotUpdateMode)]
private static void SetHotUpdateMode() => SetHotUpdateMode(HotUpdateMode.HotUpdate);
// [MenuItem(WebPlayMode)]
// private static void SetWebMode() => SetPlayerMode(HotUpdateMode.WEB_PLAYMODE);
[MenuItem(EditorNotUpdateMode, true)]
private static bool ValidateModeMenu()
{
string platform = CustomEditorPrefs.GetString("ChangeHotUpdateSchema");
Menu.SetChecked(EditorNotUpdateMode, platform == HotUpdateMode.NotUpdate.ToString());
Menu.SetChecked(EditorHotUpdateMode, platform == HotUpdateMode.HotUpdate.ToString());
//Menu.SetChecked(WebPlayMode, platform == HotUpdateMode.WEB_PLAYMODE.ToString());
Debug.Log("ChangeHotUpdateSchema:"+platform);
return true;
}
public static void SetHotUpdateMode(HotUpdateMode mode)
{
// 清除所有旧模式定义
var currentTarget = EditorUserBuildSettings.selectedBuildTargetGroup;
if (currentTarget == BuildTargetGroup.Unknown) return;
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTarget)
.Split(';')
.Where(d => !Enum.GetNames(typeof(HotUpdateMode)).Contains(d))
.ToList();
// 添加新模式
defines.Add(mode.ToString());
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
_hotUpdate = mode;
CustomEditorPrefs.SetString("ChangeHotUpdateSchema", _hotUpdate.ToString());
ValidateModeMenu();
AssetDatabase.Refresh();
// 添加解决方案文件重新生成逻辑
EditorApplication.delayCall += () =>
{
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
};
}
}
public enum HotUpdateMode
{
//非热更模式,
NotUpdate,
//热更模式
HotUpdate,
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7d18419d2d9c488687f9aff50cbd8357
timeCreated: 1751423025

View File

@@ -26,8 +26,8 @@ namespace Stary.Evo.Editor
private static void SetHostMode() => SetPlayerMode(PLayerMode.HOST_PLAYMODE);
[MenuItem(LocalPlayMode, false,3)]
private static void SetLocalMode() => SetPlayerMode(PLayerMode.LOCAL_PLAYMODE);
// [MenuItem(WebPlayMode)]
// private static void SetWebMode() => SetPlayerMode(PLayerMode.WEB_PLAYMODE);
[MenuItem(WebPlayMode)]
private static void SetWebMode() => SetPlayerMode(PLayerMode.WEB_PLAYMODE);
[MenuItem(EditorSimulateMode, true,3)]
private static bool ValidateModeMenu()
@@ -36,7 +36,7 @@ namespace Stary.Evo.Editor
Menu.SetChecked(EditorSimulateMode, platform == PLayerMode.EDITOR_SIMULATEMODE.ToString());
Menu.SetChecked(HostPlayMode, platform == PLayerMode.HOST_PLAYMODE.ToString());
Menu.SetChecked(LocalPlayMode, platform == PLayerMode.LOCAL_PLAYMODE.ToString());
//Menu.SetChecked(WebPlayMode, platform == PLayerMode.WEB_PLAYMODE.ToString());
Menu.SetChecked(WebPlayMode, platform == PLayerMode.WEB_PLAYMODE.ToString());
Debug.Log($"ChangePlayerSchema:{platform}");
return true;
}
@@ -79,6 +79,6 @@ namespace Stary.Evo.Editor
//本地运行模式
LOCAL_PLAYMODE,
// //web运行模式
// WEB_PLAYMODE
WEB_PLAYMODE
}
}

View File

@@ -2,10 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
#if HotUpdate
using HybridCLR.Editor;
using HybridCLR.Editor.Settings;
#endif
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
using UnityEditor;
@@ -119,8 +117,10 @@ namespace Stary.Evo.Editor
CreatDirectory(resPath + "/Audios");
//创建Config文件夹
CreatDirectory(resPath + "/Config");
#if !UNITY_WEBGL
//创建Dll文件夹
CreatDirectory(resPath + "/Dll");
#endif
//创建Prefabs文件夹
CreatDirectory(resPath + "/Prefabs");
//创建Scenes文件夹
@@ -174,7 +174,6 @@ namespace Stary.Evo.Editor
domainClassName = domainClassName.Replace('.', '_');
string architectureClassName = $"{domain}Architecture";
architectureClassName = architectureClassName.Replace('.', '_');
#if HotUpdate
//模块配置资源
DomainConfig moduleConfig = CreateInstance<DomainConfig>();
moduleConfig.domain = domain;
@@ -221,7 +220,6 @@ namespace Stary.Evo.Editor
HybridCLRSettings.Instance.hotUpdateAssemblyDefinitions = assemblies.ToArray();
HybridCLRSettings.Save();
}
#endif
AssetDatabase.SaveAssets();
@@ -362,8 +360,12 @@ namespace Stary.Evo.Editor
CreatDirectory(resPath + "/Audios");
//创建Config文件夹
CreatDirectory(resPath + "/Config");
//创建Dll文件夹
#if !UNITY_WEBGL
{
//创建Dll文件夹
CreatDirectory(resPath + "/Dll");
}
#endif
//创建Prefabs文件夹
CreatDirectory(resPath + "/Prefabs");
//创建Scenes文件夹

View File

@@ -36,16 +36,6 @@ namespace Stary.Evo
}
}
if (CustomEditorPrefs.GetString("ChangeHotUpdateSchema") == "")
{
ChangeHotUpdateSchema.SetHotUpdateMode(HotUpdateMode.NotUpdate);
}
else
{
ChangeHotUpdateSchema.SetHotUpdateMode(
Enum.Parse<HotUpdateMode>(CustomEditorPrefs.GetString("ChangeHotUpdateSchema")));
}
if (CustomEditorPrefs.GetString("ChangePlayerSchema") == "")
{
ChangePlayerSchema.SetPlayerMode(PLayerMode.EDITOR_SIMULATEMODE);

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
#if HotUpdate
using HybridCLR.Editor.Commands;
#endif
using Newtonsoft.Json;
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
@@ -18,15 +16,10 @@ namespace Stary.Evo.Editor
[MenuItem("Evo/Dev/(一键)打包工具",false, 3)]
static void Init()
{
#if NotUpdate
if (EditorUtility.DisplayDialog("提示", "当前为非热更模式,不支持热更打包功能,是否切换热更模式", "是", "否"))
{
ChangeHotUpdateSchema.SetHotUpdateMode(HotUpdateMode.HotUpdate);
}
#elif HotUpdate
var window = (OneKeyBuildWindow)EditorWindow.GetWindow(typeof(OneKeyBuildWindow));
window.Show();
#endif
}
[Title("全选"), OnValueChanged("OneKeyBuildEvent"), HideLabel]
@@ -53,20 +46,16 @@ namespace Stary.Evo.Editor
[Button("(一键)标记选择资源", ButtonSizes.Large)]
public void OneClickMark()
{
#if HotUpdate
AutoBuildPackage.OneClickMark(OneKeyBuildEntities);
EditorUtility.DisplayDialog("提示", $"标记所有资源完成!", "确定");
#endif
}
[Button("(一键)收集shader【材质异常或资源修改】", ButtonSizes.Large)]
public void OneShaderMark()
{
#if HotUpdate
EditorTools.ClearUnityConsole();
AutoBuildPackage.OneShaderMark(OneKeyBuildEntities,(domainName)=>
ShowNotification(new GUIContent($"收集【{domainName}】的shader【材质异常或资源修改】"), 2f));
#endif
}
[Button("(一键)获取服务器版本", ButtonSizes.Large)]