VisualElement CreateGUI(CustomFunctionNode node, InspectableAttribute attribute, out VisualElement propertyVisualElement) { var propertySheet = new PropertySheet(PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold)); PropertyDrawerUtils.AddDefaultNodeProperties(propertySheet, node, m_setNodesAsDirtyCallback, m_updateNodeViewsCallback); var inputListView = new ReorderableSlotListView(node, SlotType.Input, true); inputListView.OnAddCallback += list => inspectorUpdateDelegate(); inputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); inputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); propertySheet.Add(inputListView); var outputListView = new ReorderableSlotListView(node, SlotType.Output, true); outputListView.OnAddCallback += list => inspectorUpdateDelegate(); outputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); outputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); propertySheet.Add(outputListView); propertySheet.Add(new HlslFunctionView(node)); propertyVisualElement = null; return(propertySheet); }
VisualElement CreateGUI(SubGraphOutputNode node, InspectableAttribute attribute, out VisualElement propertyVisualElement) { var propertySheet = new PropertySheet(PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold)); var inputListView = new ReorderableSlotListView(node, SlotType.Input); inputListView.OnAddCallback += list => inspectorUpdateDelegate(); inputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); inputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); propertySheet.Add(inputListView); propertyVisualElement = propertySheet; return(propertySheet); }
VisualElement CreateGUI(SubGraphOutputNode node, InspectableAttribute attribute, out VisualElement propertyVisualElement) { var propertySheet = new PropertySheet(PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold)); PropertyDrawerUtils.AddDefaultNodeProperties(propertySheet, node, m_setNodesAsDirtyCallback, m_updateNodeViewsCallback); var inputListView = new ReorderableSlotListView(node, SlotType.Input, false); inputListView.OnAddCallback += list => inspectorUpdateDelegate(); inputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); inputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); inputListView.AllowedTypeCallback = SlotValueHelper.AllowedAsSubgraphOutput; propertySheet.Add(inputListView); propertyVisualElement = propertySheet; return(propertySheet); }