Beispiel #1
0
        public override void AddChildNodes(NodeComponent nodeComponent, TreeViewItem parentItem, IList <TreeViewItem> rows)
        {
            var node  = nodeComponent as StateNode;
            var flows = node.nestedFlowNodes;

            if (flows != null && flows.Count > 0)
            {
                var tree = new HierarchyFlowTree(nodeComponent, MemberData.none, uNodeEditorUtility.GetUIDFromString(nodeComponent.GetInstanceID() + "[EVENTS]"), -1, "Events");
                parentItem.AddChild(tree);
                rows.Add(tree);
                for (int i = 0; i < flows.Count; i++)
                {
                    manager.AddNodes(flows[i], tree, rows);
                }
            }
            var transitions = node.TransitionEvents;

            if (transitions != null && transitions.Length > 0)
            {
                //var tree = new HierarchyFlowTree(nodeComponent, MemberData.none, uNodeEditorUtility.GetUIDFromString(nodeComponent.GetInstanceID() + "[TRANSITIONS]"), -1, "Transitions");
                //parentItem.AddChild(tree);
                //rows.Add(tree);
                for (int i = 0; i < transitions.Length; i++)
                {
                    var transitionTree = new HierarchyTransitionTree(transitions[i], -1);
                    manager.AddNodeTree(transitionTree, parentItem, rows);
                    manager.AddNodeTree(transitions[i].target, transitionTree, rows);
                }
            }
        }