private void GenerateBlackBoard() { var blackboard = new Blackboard(_graphView); blackboard.Add(new BlackboardSection { title = "Exposed Properties" }); blackboard.addItemRequested = _blackbord => { _graphView.AddPropertyToBlackBoard(new ExposedProperty()); }; blackboard.editTextRequested = (blackboard1, element, newValue) => { var oldPropertyName = ((BlackboardField)element).text; if (_graphView.ExposedProperties.Any(x => x.PropertyName == newValue)) { EditorUtility.DisplayDialog("Error", "This property name is already exists, please chose another one!", "OK"); return; } var propertyIndex = _graphView.ExposedProperties.FindIndex(x => x.PropertyName == oldPropertyName); _graphView.ExposedProperties[propertyIndex].PropertyName = newValue; ((BlackboardField)element).text = newValue; }; blackboard.SetPosition(new Rect(10, 30, 200, 300)); _graphView.Add(blackboard); _graphView.Blackboard = blackboard; }
private Edge LinkNodes(Port output, Port input) { var tempEdge = new Edge { output = output, input = input }; tempEdge?.input.Connect(tempEdge); tempEdge?.output.Connect(tempEdge); _targetGraphView.Add(tempEdge); return(tempEdge); }