12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using UnityEditor;
- using UnityEngine;
- namespace XGame.Editor.Build.AssetBundles
- {
- [CustomEditor(typeof(ABPackerInfoManifest), false)]
- public class ABPackerInfoManifestInspector : UnityEditor.Editor
- {
- private SerializedProperty m_Script;
- private ABPackerInfoManifestWindow manifestEditor;
- private void OnEnable()
- {
- m_Script = serializedObject.FindProperty("m_Script");
- var manifest = serializedObject.targetObject as ABPackerInfoManifest;
- manifestEditor = new ABPackerInfoManifestWindow(manifest, true);
- }
- private void OnDisable()
- {
- manifestEditor.Close();
- manifestEditor = null;
- }
- public override void OnInspectorGUI()
- {
- serializedObject.Update();
- //展示区域,禁止操作
- EditorGUI.BeginDisabledGroup(true);
- EditorGUILayout.PropertyField(m_Script);
- GUILayout.Space(10);
- EditorGUI.EndDisabledGroup();
- manifestEditor?.OnGUI();
- serializedObject.ApplyModifiedProperties();
- //if (GUI.changed)
- //{
- // EditorUtility.SetDirty(target);
- // AssetDatabase.SaveAssets();
- //}
- }
- }
- }
|