// add a group of actions public int addActionGroup(ActionNode.NodeType p_groupType,List<ActionInterface> p_actions) { int nodeId = -1; // store actions in list List<int> actionIds = new List<int>(); foreach (ActionInterface n in p_actions) { int actionId = m_actions.add(n); actionIds.Add(actionId); } // if (m_currentNodeId >= 0) { ActionNode currentNodeRef = m_nodes[m_currentNodeId]; // and add its id to tree list ActionNode groupNode = new ActionNode(actionIds, m_currentNodeId, currentNodeRef.m_level + 1); groupNode.m_type = p_groupType; nodeId = m_nodes.add(groupNode); // then add new node index as child to parent currentNodeRef.m_children.Add(nodeId); // set starting position(render) for node groupNode.m_renderPos = currentNodeRef.m_renderPos; } else // first node { ActionNode groupNode = new ActionNode(actionIds, m_currentNodeId, 0); groupNode.m_type = p_groupType; nodeId = m_nodes.add(groupNode); } m_currentNodeId = nodeId; newNodeDirty = true; return nodeId; }
public void StartGroupingActions(ActionNode.NodeType p_nodeType) { if (grouping) { Debug.Print("Warning, Action System was asked to START grouping actions while it was already grouping actions"); } else { currentGroupType = p_nodeType; } grouping = true; }