ABPackerInfoManifestInspector.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace XGame.Editor.Build.AssetBundles
  4. {
  5. [CustomEditor(typeof(ABPackerInfoManifest), false)]
  6. public class ABPackerInfoManifestInspector : UnityEditor.Editor
  7. {
  8. private SerializedProperty m_Script;
  9. private ABPackerInfoManifestWindow manifestEditor;
  10. private void OnEnable()
  11. {
  12. m_Script = serializedObject.FindProperty("m_Script");
  13. var manifest = serializedObject.targetObject as ABPackerInfoManifest;
  14. manifestEditor = new ABPackerInfoManifestWindow(manifest, true);
  15. }
  16. private void OnDisable()
  17. {
  18. manifestEditor.Close();
  19. manifestEditor = null;
  20. }
  21. public override void OnInspectorGUI()
  22. {
  23. serializedObject.Update();
  24. //展示区域,禁止操作
  25. EditorGUI.BeginDisabledGroup(true);
  26. EditorGUILayout.PropertyField(m_Script);
  27. GUILayout.Space(10);
  28. EditorGUI.EndDisabledGroup();
  29. manifestEditor?.OnGUI();
  30. serializedObject.ApplyModifiedProperties();
  31. //if (GUI.changed)
  32. //{
  33. // EditorUtility.SetDirty(target);
  34. // AssetDatabase.SaveAssets();
  35. //}
  36. }
  37. }
  38. }