protected override void DrawNode(ModuleGraphView graphView) { var inputPort = graphView.GeneratePort <float>(this, Direction.Input, Port.Capacity.Multi); inputPort.portName = "Input"; inputContainer.Add(inputPort); //Set the Add Button titleContainer.Insert(1, new Button(() => { OutputPortIDs.Add(AddMultiRow(this, graphView).name); }) { text = "Add", style = { flexGrow = 0 } }); //Add saved port, none otherwise foreach (var guid in OutputPortIDs) { Port port = AddMultiRow(this, graphView); port.name = guid; } graphView.RefreshNode(this); graphView.AddElement(this); }
protected override void DrawNode(ModuleGraphView graphView) { Debug.Log(Script.SceneIndex); var inputPort = graphView.GeneratePort <float>(this, Direction.Input, Port.Capacity.Multi); inputPort.portName = "Input"; inputContainer.Add(inputPort); AddToClassList("action"); var outputPort = graphView.GeneratePort <float>(this, Direction.Output); outputPort.portName = "Output"; outputContainer.Add(outputPort); IntegerField intField = new IntegerField("Scene Index", 2); intField.value = Script.SceneIndex; intField.RegisterValueChangedCallback(evt => { var temp = evt.newValue < 0 ? 0 : evt.newValue > 99 ? 99 : evt.newValue; intField.SetValueWithoutNotify(temp); Script.SceneIndex = temp; graphView.SetDirty(); }); extensionContainer.Add(intField); graphView.RefreshNode(this); graphView.AddElement(this); }
protected override void DrawNode(ModuleGraphView graphView) { AddToClassList("start"); var generatedPort = graphView.GeneratePort <float>(this, Direction.Output, Port.Capacity.Multi); generatedPort.portName = "Next"; outputContainer.Add(generatedPort); capabilities &= ~Capabilities.Deletable; capabilities &= ~Capabilities.Copiable; capabilities &= ~Capabilities.Renamable; graphView.RefreshNode(this); graphView.AddElement(this); }
protected override void DrawNode(ModuleGraphView graphView) { var inputPort = graphView.GeneratePort <float>(this, Direction.Input, Port.Capacity.Multi); inputPort.portName = "Input"; inputContainer.Add(inputPort); var Success = graphView.GeneratePort <float>(this, Direction.Output); Success.portName = "Success"; Success.name = "Success"; outputContainer.Add(Success); var Failure = graphView.GeneratePort <float>(this, Direction.Output); Failure.portName = "Failure"; Failure.name = "Failure"; outputContainer.Add(Failure); graphView.RefreshNode(this); graphView.AddElement(this); }
protected override void DrawNode(ModuleGraphView graphView) { var inputPort = graphView.GeneratePort <float>(this, Direction.Input, Port.Capacity.Multi); inputPort.portName = "Input"; inputContainer.Add(inputPort); AddToClassList("action"); var outputPort = graphView.GeneratePort <float>(this, Direction.Output); outputPort.portName = "Output"; outputContainer.Add(outputPort); ObjectField objectField = new ObjectField(); objectField.objectType = typeof(GameObject); objectField.value = Script.GameObject; objectField.RegisterCallback <ChangeEvent <Object> >(evt => Script.GameObject = evt.newValue); extensionContainer.Add(objectField); graphView.RefreshNode(this); graphView.AddElement(this); }