예제 #1
0
        //Open GraphEditor initializing target graph
        public static GraphEditor OpenWindow(Graph newGraph, Component agent, IBlackboard blackboard)
        {
            var window = GetWindow <GraphEditor>();

            window.willRepaint  = true;
            window.fullDrawPass = true;
            window.rootGraph    = newGraph;
            window.targetOwner  = null;
            if (window.rootGraph != null)
            {
                window.rootGraph.agent             = agent;
                window.rootGraph.blackboard        = blackboard;
                window.rootGraph.currentChildGraph = null;
                window.rootGraph.UpdateNodeIDs(true);
                window.rootGraph.UpdateReferences();
            }

            Graph.currentSelection = null;
            if (NCPrefs.showWelcomeWindow && !Application.isPlaying && welcomeShown == false)
            {
                welcomeShown = true;
                var graphType = newGraph != null?newGraph.GetType() : null;

                WelcomeWindow.ShowWindow(graphType);
            }

            return(window);
        }
        //Open GraphEditor initializing target graph
        public static GraphEditor OpenWindow(Graph newGraph, Component agent, IBlackboard blackboard)
        {
            var window = GetWindow <GraphEditor>();

            if (newGraph != null)
            {
                //force assign references only in edit mode so that we can debug correctly
                if (!Application.isPlaying)
                {
                    newGraph.agent      = agent;
                    newGraph.blackboard = blackboard;
                }

                newGraph.currentChildGraph = null;
                newGraph.UpdateNodeIDs(false);
            }

            window.rootGraph       = newGraph;
            window.targetOwner     = null;
            Graph.currentSelection = null;

            if (NCPrefs.showWelcomeWindow && !Application.isPlaying && welcomeShown == false)
            {
                welcomeShown = true;
                WelcomeWindow.OpenWindow();
            }

            return(window);
        }
예제 #3
0
        ///Open GraphEditor initializing target graph
        public static GraphEditor OpenWindow(Graph newGraph, GraphOwner owner, IBlackboard blackboard)
        {
            var window = GetWindow <GraphEditor>();

            SetReferences(newGraph, owner, blackboard);
            if (NCPrefs.showWelcomeWindow && !Application.isPlaying && welcomeShown == false)
            {
                welcomeShown = true;
                var graphType = newGraph != null?newGraph.GetType() : null;

                WelcomeWindow.ShowWindow(graphType);
            }
            return(window);
        }
예제 #4
0
 public static void ShowWelcome()
 {
     WelcomeWindow.ShowWindow(null);
 }
예제 #5
0
 public static void ShowWelcome()
 {
     WelcomeWindow.ShowWindow(typeof(NodeCanvas.BehaviourTrees.BehaviourTree));
 }