oomphies
This commit is contained in:
parent
b4a66d7e26
commit
0614e27cd5
@ -10,12 +10,10 @@ namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
public FieldInfo fieldInfo;
|
||||
private VisualElement _exposedPropertyContainer;
|
||||
|
||||
public VisualElement ExposedPropertyContainer
|
||||
{
|
||||
set
|
||||
{
|
||||
Debug.Log($"🔥 Someone is SETTING ExposedPropertyContainer to {value} 🔥");
|
||||
_exposedPropertyContainer = value;
|
||||
}
|
||||
get
|
||||
|
@ -22,6 +22,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
|
||||
private ImageProcessingGraphViewWindow window;
|
||||
|
||||
private StyleSheet defaaStyleSheet;
|
||||
private StyleSheet errorStyleSheet;
|
||||
|
||||
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)
|
||||
{
|
||||
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/Node.uss") as StyleSheet;
|
||||
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/NodeError.uss") as StyleSheet;
|
||||
}
|
||||
|
||||
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
|
||||
public void ExposeVariableToPort(Port port, FieldInfo field)
|
||||
{
|
||||
VisualElement NewElement;
|
||||
var ExposedPropertyContainer = ((IPTPort)port).ExposedPropertyContainer;
|
||||
Type containerType = null;
|
||||
|
||||
if (ExposedPropertyContainer == null)
|
||||
{
|
||||
var NewElement = new VisualElement();
|
||||
NewElement = new VisualElement();
|
||||
NewElement.name = "property-field-container";
|
||||
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)
|
||||
|
7
Node.uss
7
Node.uss
@ -1,7 +1,4 @@
|
||||
#node-border
|
||||
#input
|
||||
{
|
||||
border-bottom-color: red;
|
||||
border-left-color: red;
|
||||
border-right-color: red;
|
||||
border-top-color: red;
|
||||
flex-shrink: 1
|
||||
}
|
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