GraphAssetInspector.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using GraphProcessor;
  6. using UnityEngine.UIElements;
  7. [CustomEditor(typeof(BaseGraph), true)]
  8. public class GraphAssetInspector : GraphInspector
  9. {
  10. // protected override void CreateInspector()
  11. // {
  12. // }
  13. protected override void CreateInspector()
  14. {
  15. base.CreateInspector();
  16. root.Add(new Button(() => EditorWindow.GetWindow<DefaultGraphWindow>().InitializeGraph(target as BaseGraph))
  17. {
  18. text = "Open base graph window"
  19. });
  20. root.Add(new Button(() => EditorWindow.GetWindow<CustomContextMenuGraphWindow>().InitializeGraph(target as BaseGraph))
  21. {
  22. text = "Open custom context menu graph window"
  23. });
  24. root.Add(new Button(() => EditorWindow.GetWindow<CustomToolbarGraphWindow>().InitializeGraph(target as BaseGraph))
  25. {
  26. text = "Open custom toolbar graph window"
  27. });
  28. root.Add(new Button(() => EditorWindow.GetWindow<ExposedPropertiesGraphWindow>().InitializeGraph(target as BaseGraph))
  29. {
  30. text = "Open exposed properties graph window"
  31. });
  32. }
  33. }