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);
            }
        }
Esempio n. 2
0
        private Texture2D _indentationIcon; // Icon for indentation hack

        public void Init(EditorWindow editorWindow, DialogueGraphView graphView)
        {
            _graphView    = graphView;
            _editorWindow = editorWindow;

            // Transparent icon to fix indentation in search window groups
            _indentationIcon = new Texture2D(1, 1);
            _indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0));
            _indentationIcon.Apply();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates the default instance of DialogueGraphView.
        /// </summary>
        /// <returns>Returns a default DialogueGraphView.</returns>
        private DialogueGraphView GenerateGraphView()
        {
            DialogueGraphView graphView = new DialogueGraphView(this)
            {
                name = "Dialogue Graph"
            };

            graphView.style.flexGrow = 1;

            return(graphView);
        }
Esempio n. 4
0
        public BlackboardProvider(DialogueGraphView graphView)
        {
            this.graphView = graphView;

            Blackboard = new Blackboard
            {
                scrollable        = true,
                addItemRequested  = AddItemRequested,
                editTextRequested = EditTextRequested
            };
        }
 public DialogueGraphDataUtility(DialogueGraphView targetGraphView)
 {
     this.targetGraphView = targetGraphView;
 }
 public DialogueGraphDataUtility()
 {
     // Default constructor to just save container. Doesn't target a graph;
     targetGraphView = null;
 }