Example #1
0
        public void SetupSkinParams()
        {
            _rect = new Rect(0, 0, _parentNode.NodeEditor.SkinItem.inConnectorSize, _parentNode.NodeEditor.SkinItem.inConnectorSize);
            Texture buttonStyleType         = _parentNode.NodeEditor.SkinItem.defaultInConnector;
            Texture selectedButtonStyleType = _parentNode.NodeEditor.SkinItem.selectedInConnector;
            Texture filledStyleType         = _parentNode.NodeEditor.SkinItem.filledInConnector;

            if (_type == TYPE.OUT)
            {
                buttonStyleType         = _parentNode.NodeEditor.SkinItem.defaultOutConnector;
                selectedButtonStyleType = _parentNode.NodeEditor.SkinItem.selectedOutConnector;
                filledStyleType         = _parentNode.NodeEditor.SkinItem.filledOutConnector;
                _rect = new Rect(0, 0, _parentNode.NodeEditor.SkinItem.outConnectorSize, _parentNode.NodeEditor.SkinItem.outConnectorSize);
            }

            _defaultStyle  = ZEditorUtils.CreateGUIStyle(buttonStyleType);
            _selectedStyle = ZEditorUtils.CreateGUIStyle(selectedButtonStyleType);
            _filledStyle   = ZEditorUtils.CreateGUIStyle(filledStyleType);
        }
Example #2
0
        public ZNodeCreator(ZNodeEditor editor)
        {
            _editor = editor;

            _editor.OnNodeSelected += OnNodeSelected;

            _titleStyle           = new GUIStyle("WhiteLabel");
            _titleStyle.alignment = TextAnchor.MiddleCenter;
            _titleStyle.fontStyle = FontStyle.Bold;

            _textStyle           = new GUIStyle("WhiteLabel");
            _textStyle.alignment = TextAnchor.MiddleLeft;
            _textStyle.fontStyle = FontStyle.Normal;

            _searchStyle  = ZEditorUtils.CreateGUIStyle(_editor.SkinItem.searchIcon);
            _searchString = "";

            _compositeNodeList = (ZNodeComposite.NODE_TYPE[])System.Enum.GetValues(typeof(ZNodeComposite.NODE_TYPE));
            _decoratorNodeList = (ZNodeDecorator.NODE_TYPE[])System.Enum.GetValues(typeof(ZNodeDecorator.NODE_TYPE));
            _actionNodeList    = (ZBTActionManager.NODE_TYPE[])System.Enum.GetValues(typeof(ZBTActionManager.NODE_TYPE));
        }
Example #3
0
        void SetupSkinParams()
        {
            _xStyle    = ZEditorUtils.CreateGUIStyle(_editorSkinItem.x);
            _plusStyle = ZEditorUtils.CreateGUIStyle(_editorSkinItem.plus);
            _leftArrowInactiveStyle  = ZEditorUtils.CreateGUIStyle(_editorSkinItem.leftArrowInactive);
            _leftArrowActiveStyle    = ZEditorUtils.CreateGUIStyle(_editorSkinItem.leftArrowActive);
            _rightArrowInactiveStyle = ZEditorUtils.CreateGUIStyle(_editorSkinItem.rightArrowInactive);
            _rightArrowActiveStyle   = ZEditorUtils.CreateGUIStyle(_editorSkinItem.rightArrowActive);
            _zoomInStyle             = ZEditorUtils.CreateGUIStyle(_editorSkinItem.zoomIn);
            _zoomOutStyle            = ZEditorUtils.CreateGUIStyle(_editorSkinItem.zoomOut);

            _minZoom     = _editorSkinItem.minZoom;
            _maxZoom     = _editorSkinItem.maxZoom;
            _currentZoom = _editorSkinItem.startZoom;

            if (_currentNodeTree != null)
            {
                _currentNodeTree.RefreshSkin();
                if (_editorSkinItem.autoLayoutAsDefault)
                {
                    _currentNodeTree.AutoLayout();
                }
            }
        }