oomphies
This commit is contained in:
parent
b4a66d7e26
commit
0614e27cd5
@ -10,12 +10,10 @@ namespace ImageProcessingGraph.Editor
|
|||||||
{
|
{
|
||||||
public FieldInfo fieldInfo;
|
public FieldInfo fieldInfo;
|
||||||
private VisualElement _exposedPropertyContainer;
|
private VisualElement _exposedPropertyContainer;
|
||||||
|
|
||||||
public VisualElement ExposedPropertyContainer
|
public VisualElement ExposedPropertyContainer
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Debug.Log($"🔥 Someone is SETTING ExposedPropertyContainer to {value} 🔥");
|
|
||||||
_exposedPropertyContainer = value;
|
_exposedPropertyContainer = value;
|
||||||
}
|
}
|
||||||
get
|
get
|
||||||
|
@ -22,6 +22,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
|
|
||||||
private ImageProcessingGraphViewWindow window;
|
private ImageProcessingGraphViewWindow window;
|
||||||
|
|
||||||
|
private StyleSheet defaaStyleSheet;
|
||||||
private StyleSheet errorStyleSheet;
|
private StyleSheet errorStyleSheet;
|
||||||
|
|
||||||
public ImageProcessingGraphNodeVisual(BaseImageNode node, ImageProcessingGraphViewWindow window)
|
public ImageProcessingGraphNodeVisual(BaseImageNode node, ImageProcessingGraphViewWindow window)
|
||||||
@ -79,10 +80,17 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
errorStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/Node.uss");
|
defaaStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/Node.uss");
|
||||||
|
if (defaaStyleSheet == null)
|
||||||
|
{
|
||||||
|
defaaStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/Node.uss") as StyleSheet;
|
||||||
|
}
|
||||||
|
styleSheets.Add(defaaStyleSheet);
|
||||||
|
|
||||||
|
errorStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/NodeError.uss");
|
||||||
if (errorStyleSheet == null)
|
if (errorStyleSheet == null)
|
||||||
{
|
{
|
||||||
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/Node.uss") as StyleSheet;
|
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/NodeError.uss") as StyleSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
graphNode.onFailed += () =>
|
graphNode.onFailed += () =>
|
||||||
@ -139,12 +147,13 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
// Exposes a variable on the port for editing when it's not connected
|
// Exposes a variable on the port for editing when it's not connected
|
||||||
public void ExposeVariableToPort(Port port, FieldInfo field)
|
public void ExposeVariableToPort(Port port, FieldInfo field)
|
||||||
{
|
{
|
||||||
|
VisualElement NewElement;
|
||||||
var ExposedPropertyContainer = ((IPTPort)port).ExposedPropertyContainer;
|
var ExposedPropertyContainer = ((IPTPort)port).ExposedPropertyContainer;
|
||||||
Type containerType = null;
|
Type containerType = null;
|
||||||
|
|
||||||
if (ExposedPropertyContainer == null)
|
if (ExposedPropertyContainer == null)
|
||||||
{
|
{
|
||||||
var NewElement = new VisualElement();
|
NewElement = new VisualElement();
|
||||||
NewElement.name = "property-field-container";
|
NewElement.name = "property-field-container";
|
||||||
VisualElement the = CreatePropertyFieldForType(field.FieldType, field.GetValue(graphNode));
|
VisualElement the = CreatePropertyFieldForType(field.FieldType, field.GetValue(graphNode));
|
||||||
|
|
||||||
@ -242,7 +251,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
port.Add(ExposedPropertyContainer);
|
port.Add(NewElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleExposedVariable(Port port, bool value)
|
public void ToggleExposedVariable(Port port, bool value)
|
||||||
|
7
Node.uss
7
Node.uss
@ -1,7 +1,4 @@
|
|||||||
#node-border
|
#input
|
||||||
{
|
{
|
||||||
border-bottom-color: red;
|
flex-shrink: 1
|
||||||
border-left-color: red;
|
|
||||||
border-right-color: red;
|
|
||||||
border-top-color: red;
|
|
||||||
}
|
}
|
7
NodeError.uss
Normal file
7
NodeError.uss
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#node-border
|
||||||
|
{
|
||||||
|
border-bottom-color: red;
|
||||||
|
border-left-color: red;
|
||||||
|
border-right-color: red;
|
||||||
|
border-top-color: red;
|
||||||
|
}
|
3
NodeError.uss.meta
Normal file
3
NodeError.uss.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ecdb9925f9c4d018e1e54b8ae734ccb
|
||||||
|
timeCreated: 1745808720
|
Loading…
x
Reference in New Issue
Block a user