diff --git a/Editor/Scripts/Editor/AssetGraphData.cs b/Editor/Scripts/Editor/AssetGraphData.cs index e3b2a96..c234c88 100644 --- a/Editor/Scripts/Editor/AssetGraphData.cs +++ b/Editor/Scripts/Editor/AssetGraphData.cs @@ -16,9 +16,9 @@ namespace AssetGraph.Core [CreateAssetMenu(menuName = "Image Processing Graph/New Graph")] public class AssetGraphData : ScriptableObject { - [SerializeField] private List nodes; + [SerializeReference] private List nodes; [SerializeField] private List connections; - [SerializeField] public List runOrder; + [SerializeReference] public List runOrder; [SerializeField] public List stickyNotes; public List Nodes => nodes; diff --git a/Editor/Scripts/Editor/Windows/AssetGraphEditorWindow.cs b/Editor/Scripts/Editor/Windows/AssetGraphEditorWindow.cs index 0b8cec1..2a1fa36 100644 --- a/Editor/Scripts/Editor/Windows/AssetGraphEditorWindow.cs +++ b/Editor/Scripts/Editor/Windows/AssetGraphEditorWindow.cs @@ -61,6 +61,7 @@ namespace AssetGraph.Core serializedObject = new SerializedObject(currentGraph); currentView = new AssetGraphViewWindow(serializedObject, this); currentView.graphViewChanged += OnChange; + rootVisualElement.style.flexGrow = 1; rootVisualElement.Add(currentView); } diff --git a/Editor/Scripts/Editor/Windows/AssetGraphViewWindow.cs b/Editor/Scripts/Editor/Windows/AssetGraphViewWindow.cs index f87b5f9..9f56fdd 100644 --- a/Editor/Scripts/Editor/Windows/AssetGraphViewWindow.cs +++ b/Editor/Scripts/Editor/Windows/AssetGraphViewWindow.cs @@ -48,13 +48,15 @@ namespace AssetGraph.Core searchProvider = ScriptableObject.CreateInstance(); searchProvider.graph = this; - + edgeConnectorListener = new AssetGraphEdgeConnector(this); this.nodeCreationRequest = ShowSearchWindow; - + this.window = window; + + StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath("Assets/Unity Image Processing/GraphView.uss"); if (styleSheet == null) { @@ -64,12 +66,12 @@ namespace AssetGraph.Core GridBackground background = new GridBackground(); background.name = "Grid"; - Add(background); + this.Add(background); background.SendToBack(); - + CreateButtons(); - - + + this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector()); diff --git a/GraphView.uss b/GraphView.uss index 99c9258..01e4f67 100644 --- a/GraphView.uss +++ b/GraphView.uss @@ -1,4 +1,4 @@ -ImageProcessingGraphViewWindow +AssetGraphViewWindow { flex-grow: 1; }