Esempio n. 1
0
        /// <summary>
        /// Prepares the window elements.
        /// </summary>
        private void InitializeGraphView()
        {
            // Set the root elements flex direction
            rootVisualElement.style.flexDirection = FlexDirection.Column;

            // Create the window elements
            rootVisualElement.Add(GenerateToolbar());

            _graphView = GenerateGraphView();
            rootVisualElement.Add(_graphView);

            _miniMap = GenerateMiniMap();
            _graphView.Add(_miniMap);

            blackboardProvider = new BlackboardProvider(_graphView);
            _graphView.Add(blackboardProvider.Blackboard);

            // Get the data utility so we can save and load.
            dialogueGraphDataUtility = new DialogueGraphDataUtility(_graphView);

            if (dialogueContainer != null)
            {
                dialogueGraphDataUtility.LoadGraph(dialogueContainer, blackboardProvider);
            }
        }
        private void LinkNodes(Port output, Port input)
        {
            var tempEdge = new Edge
            {
                output = output,
                input  = input
            };

            tempEdge.input.Connect(tempEdge);
            tempEdge.output.Connect(tempEdge);

            targetGraphView.Add(tempEdge);
        }