From 4985cf574894d06d19b0f3a8fd6fcfda27a3deb8 Mon Sep 17 00:00:00 2001 From: Chromium <62724067+Chromum@users.noreply.github.com> Date: Sun, 27 Apr 2025 00:55:14 +0100 Subject: [PATCH] Added Run button --- .../Windows/ImageProcessingGraphNodeVisual.cs | 1 - .../Windows/ImageProcessingGraphViewWindow.cs | 26 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Editor/Scripts/Editor/Windows/ImageProcessingGraphNodeVisual.cs b/Editor/Scripts/Editor/Windows/ImageProcessingGraphNodeVisual.cs index 8f1b3a3..342a163 100644 --- a/Editor/Scripts/Editor/Windows/ImageProcessingGraphNodeVisual.cs +++ b/Editor/Scripts/Editor/Windows/ImageProcessingGraphNodeVisual.cs @@ -200,7 +200,6 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind }); } - propertyFieldContainer.Add(propertyField); port.Add(propertyFieldContainer); } diff --git a/Editor/Scripts/Editor/Windows/ImageProcessingGraphViewWindow.cs b/Editor/Scripts/Editor/Windows/ImageProcessingGraphViewWindow.cs index d194e57..fe897fe 100644 --- a/Editor/Scripts/Editor/Windows/ImageProcessingGraphViewWindow.cs +++ b/Editor/Scripts/Editor/Windows/ImageProcessingGraphViewWindow.cs @@ -52,12 +52,34 @@ namespace ImageProcessingGraph.Editor GridBackground background = new GridBackground(); background.name = "Grid"; - + + Button runButton = new Button(); + runButton.text = "Run"; + +// Set the size of the button (width and height) + runButton.style.width = 100; // Width in pixels + runButton.style.height = 40; // Height in pixels + +// Position the button at the top-left corner + runButton.style.position = Position.Absolute; // Make sure it's positioned absolutely + runButton.style.top = 10; // Top 10 pixels from the top + runButton.style.left = 10; // Left 10 pixels from the left edge + +// On click, execute the function + runButton.clicked += () => + { + asset.RunGraph(); + }; + +// Add the button to the UI + Add(runButton); Add(background); - background.SendToBack(); + + + this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector());