Esempio n. 1
0
        private NodeSearchWindow searchWindow;                  // Search window

        // Spawning graph view
        public DialogueGraphView(DialogueEditorWindow newEditorWindow)
        {
            editorWindow = newEditorWindow;

            // Adding and loading this editor .css
            StyleSheet tmpStyleSheet = Resources.Load <StyleSheet>(styleSheetsName);

            styleSheets.Add(tmpStyleSheet);

            // Adding zoom to the editor
            SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale);

            this.AddManipulator(new ContentDragger());    // Ability to drag content
            this.AddManipulator(new SelectionDragger());  // Ability to drag selection
            this.AddManipulator(new RectangleSelector()); // Adding rectangle selector
            this.AddManipulator(new FreehandSelector());  // Adding keyboard selection

            // Adding grid to background
            GridBackground grid = new GridBackground();

            Insert(0, grid);
            grid.StretchToParentSize();

            AddSearchWindow();
        }
Esempio n. 2
0
        private Texture2D pic;                     // Texture displayed before node name

        public void Configure(DialogueEditorWindow newEditorWindow, DialogueGraphView newGraphView)
        {
            editorWindow = newEditorWindow;
            graphView    = newGraphView;

            // Setting this picture before node name, it is transparent, so the names are evenly aligned
            pic = new Texture2D(1, 1);
            pic.SetPixel(0, 0, new Color(0, 0, 0, 0));
            pic.Apply();
        }