protected override void onRemoveCallback(UnityEditorInternal.ReorderableList list) { if (EditorUtility.DisplayDialog("Warning!", "Are you sure you want to delete this pin? " + list.index, "Yes", "No")) { var data = _node.Weights[list.index]; var output = _node.PinCollection.Get(data.OutputName); if (output != null) { WireController.Disconnect(output); } _node.Variables.RemoveByName(data.VariableName); _node.PinCollection.Remove(data.OutputName); _node.Weights.Remove(data); _node.HasChanges = true; } }
protected override void onRemoveCallback(UnityEditorInternal.ReorderableList list) { if (EditorUtility.DisplayDialog("Warning!", "Are you sure you want to delete this answer?", "Yes", "No")) { var element = _node.Answers[list.index]; var input = _node.PinCollection.Get(element.InputName); var output = _node.PinCollection.Get(element.OutputName); if (input != null) { WireController.Disconnect(input); } if (output != null) { WireController.Disconnect(output); } _node.PinCollection.Remove(element.InputName); _node.PinCollection.Remove(element.OutputName); _node.Variables.RemoveByName(element.VariableName); ReorderableList.defaultBehaviours.DoRemoveButton(list); } }