예제 #1
0
 public bool AddPrevious(PathNode previous)
 {
     if (HasPrevious(previous))
     {
         return(false);
     }
     else
     {
         previousNodes.Add(previous);
         previous.AddNext(this);
         return(true);
     }
 }
예제 #2
0
    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;
        }
    }