using System; using System.Collections.Generic; using System.IO; using TFramework; using TModule.Runtime; using UnityEditor; using UnityEngine; namespace Tmodule.Editor { [CustomEditor(typeof(HotfixManager))] public class HotfixManagerInsoector : UnityEditor.Editor { private SerializedProperty isHotfix; private GUIContent isHotfixGC = new GUIContent("启用热更"); private SerializedProperty resServerUrl; private GUIContent resServerUrlGC = new GUIContent("热更服务器地址"); private SerializedProperty loadMode; private GUIContent loadModeGC = new GUIContent("加载模式", "Editor:编辑器模式(不加载AB包)\n Loacl:本地热更模式(加载StreamingAssets下AB包)\n Bulid:打包热更模式(从服务器下载并加载AB包)\n 打包版本在启用热更情况下强制Build模式"); private SerializedProperty hotfixDllName; private GUIContent hotfixDllNameGC = new GUIContent("热更程序集"); private SerializedProperty hotfixClass; private GUIContent hotfixClassGC = new GUIContent("热更启动类","注意!应填入类的完全限定名(带命名空间)"); private void OnEnable() { isHotfix = serializedObject.FindProperty("isHotfix"); resServerUrl = serializedObject.FindProperty("resServerUrl"); loadMode = serializedObject.FindProperty("loadMode"); hotfixDllName = serializedObject.FindProperty("hotfixDllName"); hotfixClass = serializedObject.FindProperty("hotfixClass"); } public override void OnInspectorGUI() { //base.OnInspectorGUI(); serializedObject.Update(); EditorGUILayout.PropertyField(isHotfix, isHotfixGC); EditorGUILayout.PropertyField(resServerUrl, resServerUrlGC); EditorGUILayout.PropertyField(loadMode, loadModeGC); EditorGUILayout.PropertyField(hotfixDllName, hotfixDllNameGC); EditorGUILayout.PropertyField(hotfixClass, hotfixClassGC); serializedObject.ApplyModifiedProperties(); } } }