public GameObject AddNode(MBGraphNode from = null, float edgeWeight = default, EdgeDirectionality directionality = default) { GameObject obj = new GameObject("Node", typeof(MBGraphNode)); obj.transform.parent = transform; obj.transform.position = from != null ? from.transform.position : transform.position; MBGraphNode graphNodeComponent = obj.GetComponent <MBGraphNode>(); graphNodeComponent.mbGraph = this; if (from == null) { graphNodeComponent.nodeId = graph.AddNode(obj).Id; } else { graphNodeComponent.nodeId = graph.AddNode(obj, from.nodeId, edgeWeight, directionality).Id; } return(obj); }
public void DestroyNode(MBGraphNode node) { Destroy(node); }
public void RemoveEdge(MBGraphNode from, MBGraphNode to, float edgeWeight = default, EdgeDirectionality directionality = default) { RemoveEdge(from.nodeId, to.nodeId); }
public void SetEdge(MBGraphNode from, MBGraphNode to, float edgeWeight = default, EdgeDirectionality directionality = default) { SetEdge(from.nodeId, to.nodeId, edgeWeight, directionality); }