public bool AddPrevious(PathNode previous) { if (HasPrevious(previous)) { return(false); } else { previousNodes.Add(previous); previous.AddNext(this); return(true); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); PathNode node = target as PathNode; if (GUILayout.Button("Create Node")) { PathNode next = node.Graph.CreateNode(); node.AddNext(next); next.transform.position = node.transform.position; Selection.activeGameObject = next.gameObject; } }