Example #1
0
        public void AddLocalizedNode(string name, string displayName)
        {
            currentNode = flowChartTree.GetNode(name);
            if (currentNode == null)
            {
                throw new ArgumentException($"Nova: Node {name} not found.");
            }

            currentNode.AddLocalizedName(stateLocale, displayName);
        }
Example #2
0
        /// <summary>
        /// Create a new flow chart node register it to the current constructing FlowChartTree.
        /// If the current node is a normal node, the newly created one is intended to be its
        /// succeeding node. The link between the new node and the current one will be added immediately, which
        /// will not be registered as a lazy binding link.
        /// This method is designed to be called externally by scripts.
        /// </summary>
        /// <param name="name">Internal name of the new node</param>
        /// <param name="displayName">Displayed name of the new node</param>
        public void RegisterNewNode(string name, string displayName)
        {
            var nextNode = new FlowChartNode(name);

            if (currentNode != null && currentNode.type == FlowChartNodeType.Normal)
            {
                currentNode.AddBranch(BranchInformation.Default, nextNode);
            }

            currentNode = nextNode;

            flowChartTree.AddNode(currentNode);

            currentNode.AddLocalizedName(stateLocale, displayName);
        }