Added Run button

This commit is contained in:
Chromium 2025-04-27 00:55:14 +01:00
parent 462bf4ffc0
commit 4985cf5748
2 changed files with 24 additions and 3 deletions

View File

@ -200,7 +200,6 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
});
}
propertyFieldContainer.Add(propertyField);
port.Add(propertyFieldContainer);
}

View File

@ -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());