Example #1
0
        public static string SetUp(UINavRepository r, NavigationComponent panel)
        {
            List <NavStateBuildNode> graphNodes = new List <NavStateBuildNode>();

            SetUpP(r, out NavStartBuildNode start, out NavNestedEndBuildNode end, graphNodes);

            //if (start.next is NavStateBuildNode t)
            //{
            //    Debug.Log("Debuging Graph:" + t.DebugGraph());
            //}

            foreach (var graphNode in graphNodes)
            {
                graphNode.TransformToActivity(panel);
            }

            if (r != null)
            {
                panel.DefaultInAnimation     = r.DefaultInAnimation;
                panel.DefaultOutAnimation    = r.DefaultOutAnimation;
                panel.DefaultInputController = r.DefaultInputController;
            }

            if (start.next is NavStateBuildNode navStartBuildNode)
            {
                return(navStartBuildNode.data.PanelName);
            }
            return("");
        }
Example #2
0
 public NavNestedNodeData(string guid, Vector2 editorPosition, NavOutputPortData outputPort, NavOutputPortData backPort, UINavRepository nestedGraph)
     : base(guid, editorPosition)
 {
     OutputPort  = outputPort;
     BackPort    = backPort;
     NestedGraph = nestedGraph;
 }
Example #3
0
        internal static void SetUpP(UINavRepository r, out NavStartBuildNode start, out NavNestedEndBuildNode end, List <NavStateBuildNode> graphNodes)
        {
            if (r == null)
            {
                Debug.LogError("UINavRepository is null of NestedNode or Component");
                start = new NavStartBuildNode(new NavStartNodeData(Guid.NewGuid().ToString(), Vector2.zero, new NavOutputPortData("Out", "")));
                end   = new NavNestedEndBuildNode(new NavNestedEndNodeData(Guid.NewGuid().ToString(), Vector2.zero, new NavOutputPortData("Out", "")));
            }
            Dictionary <string, NavBuildNode> registeredTasks = new Dictionary <string, NavBuildNode>();

            start = new NavStartBuildNode(r.StartNode);
            registeredTasks.Add(r.StartNode.Guid, start);

            end = new NavNestedEndBuildNode(r.NestedEndNode);
            registeredTasks.Add(r.NestedEndNode.Guid, end);

            foreach (var d in r.StateNodes)
            {
                registeredTasks.Add(d.Guid, new NavStateBuildNode(d));
            }

            List <NavNestedBuildNode> nestedTasks = new List <NavNestedBuildNode>();

            foreach (var e in r.NestedNodes)
            {
                NavNestedBuildNode t = new NavNestedBuildNode(e, graphNodes);
                registeredTasks.Add(e.Guid, t);
                nestedTasks.Add(t);
            }

            foreach (var t in registeredTasks)
            {
                t.Value.Init(registeredTasks);
            }

            foreach (var nestedTask in nestedTasks)
            {
                nestedTask.InitNested();
            }

            graphNodes.AddRange(registeredTasks.Values.Where(node => node is NavStateBuildNode).Cast <NavStateBuildNode>());
        }