Пример #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;
        }
    }