Exemple #1
0
        //LOAD DIALOGUE SCRIPT

        /// <summary>
        /// Method responsible for creating a new Dialogue Node
        /// based on an already existing one
        /// </summary>
        /// <param name="data">Data to base the new Node out of</param>
        public void InstatiateDialogueNode(NodeData data)
        {
            DialogueNode node = new DialogueNode
            {
                GUID       = data.GUID,
                title      = "",
                DialogText = data.Dialogue
            };

            node = AppendDefaultItems(node, data);
            node.SetPosition(data.Position);
        }
Exemple #2
0
        /// <summary>
        /// Method responsible for creating the "Start" node of the
        /// Dialogue System
        /// </summary>
        /// <returns>The first Node</returns>
        private DialogueNode GenerateFirstNode()
        {
            DialogueNode node = new DialogueNode
            {
                title      = "Start",
                GUID       = Guid.NewGuid().ToString(),
                DialogText = "ENTRYPOINT",
                EntryPoint = true
            };

            Port generatePort = GeneratePort(node, Direction.Output);

            generatePort.portName = "Next";
            node.outputContainer.Add(generatePort);

            node.RefreshExpandedState();
            node.RefreshPorts();

            node.SetPosition(new Rect(100, 200, 100, 150));
            return(node);
        }