mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
自动同步UpdateSetting到HybridCLRSetting
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using HybridCLR.Editor.Settings;
|
||||
using UnityEditor;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
[CustomEditor(typeof(UpdateSetting), true)]
|
||||
public class UpdateSettingEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
// 记录对象修改前的状态
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
// 绘制默认的 Inspector 界面
|
||||
base.OnInspectorGUI();
|
||||
|
||||
// 检测是否有字段被修改
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
// 获取当前编辑的 ScriptableObject 实例
|
||||
UpdateSetting so = (UpdateSetting)target;
|
||||
|
||||
// 标记对象为“已修改”,确保修改能被保存
|
||||
EditorUtility.SetDirty(so);
|
||||
|
||||
HybridCLRSettings.Instance.hotUpdateAssemblies = so.HotUpdateAssemblies.ToArray();
|
||||
HybridCLRSettings.Instance.patchAOTAssemblies = so.AOTMetaAssemblies.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7ca490137b34f09b27a5564d3d246d9
|
||||
timeCreated: 1742208162
|
@@ -14,7 +14,6 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
projectName: Demo
|
||||
HotUpdateAssemblies:
|
||||
- GameBase.dll
|
||||
- GameProto.dll
|
||||
- GameLogic.dll
|
||||
AOTMetaAssemblies:
|
||||
@@ -25,5 +24,7 @@ MonoBehaviour:
|
||||
LogicMainDllName: GameLogic.dll
|
||||
AssemblyTextAssetExtension: .bytes
|
||||
AssemblyTextAssetPath: AssetRaw/DLL
|
||||
UpdateStyle: 2
|
||||
UpdateNotice: 1
|
||||
ResDownLoadPath: http://127.0.0.1:8081
|
||||
FallbackResDownLoadPath: http://127.0.0.1:8082
|
||||
|
Reference in New Issue
Block a user