コード例 #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);
            }
        }
コード例 #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();
        }
コード例 #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);
        }
コード例 #4
0
        public BlackboardProvider(DialogueGraphView graphView)
        {
            this.graphView = graphView;

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