【m】优化热更资源配置及APK打包窗口

1.处理了热更资源配置Editor脚本中冗余的部分
2.将热更资源配置继承基类改为OdinEditor,使其能适配Odin
3.重新整理了打包部分的代码块
4.添加了允许同时选择多个子包打包的逻辑(开发中)
5.添加了选择子包时查看其全局配置的逻辑
This commit is contained in:
mzh
2026-03-31 15:35:26 +08:00
parent 428b6f50b6
commit 481511c577
3 changed files with 99 additions and 74 deletions

View File

@@ -1,37 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector.Editor;
using Stary.Evo;
using Stary.Evo.Editor;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(HotfixMainResDomain))]
public class HotfixMainResDomainEditor : UnityEditor.Editor
public class HotfixMainResDomainEditor : OdinEditor
{
/// <summary>
/// 序列化属性在OnEnable中获取
/// </summary>
[HideInInspector]
private SerializedProperty projectInfo;
private void OnEnable()
{
projectInfo = serializedObject.FindProperty("projectInfo");
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
HotfixMainResDomain hotfixMainResDomain = (HotfixMainResDomain)target;
hotfixMainResDomain.projectInfo.projectPackageName = $"com.xosmo.{hotfixMainResDomain.projectInfo.projectCode}";
if (hotfixMainResDomain.projectInfo.loadingScene == null)
{
Debug.LogError("HotfixMainResDomain 资源中loadingScene索引不存在请检查");
return;
}
// 获取loadingScene的Assets相对路径
hotfixMainResDomain.projectInfo.loadingScenePath = AssetDatabase.GetAssetPath(hotfixMainResDomain.projectInfo.loadingScene);
var config = (HotfixMainResDomain)target;
config.projectInfo.projectPackageName = $"com.xosmo.{config.projectInfo.projectCode}";
}
}