private void Splitter_Dragged(DraggableSeparator sender, double x, double y, double dx, double dy) { var newWidth = _splitterStartDragWidth.Value - x; if (newWidth >= 0 && newWidth + ColumnSplitter.Width.Value <= Width) { ColumnTree.Width = _treeViewWidth = new GridLength(newWidth); } }
public bool InitializeInstance(Shader initShader = null) { //Setting Initialization this.initialized = true; preview = new VS_PreviewWindow(); statusBox = new VS_StatusBox(); statusBox.Initialize(); //Use Scriptable Object Because we can use Undo ...... which Unity Provide ScriptableObject.CreateInstance <VVS_PassSettings>(); //InitializeNodeTemplates(); windowStyle = new GUIStyle(EditorStyles.textField); windowStyle.margin = new RectOffset(0, 0, 0, 0); windowStyle.padding = new RectOffset(0, 0, 0, 0); titleStyle = new GUIStyle(EditorStyles.largeLabel); titleStyle.fontSize = 24; versionStyle = new GUIStyle(EditorStyles.miniBoldLabel); versionStyle.alignment = TextAnchor.MiddleLeft; versionStyle.fontSize = 9; versionStyle.normal.textColor = Color.gray; versionStyle.padding.left = 1; versionStyle.padding.top = 1; versionStyle.padding.bottom = 1; versionStyle.margin.left = 1; versionStyle.margin.top = 3; versionStyle.margin.bottom = 1; separatorLeft = new DraggableSeparator(VS_GUI.Handle_drag); separatorRight = new DraggableSeparator(VS_GUI.Handle_drag); separatorLeft.rect = new Rect(340, 0, 0, 0); separatorRight.rect = new Rect(Screen.width - 130f, 0, 0, 0); //Create Nodes List this.nodes = new List <VS_Node>(); // Create main output node and add to list nodeCanvas = VS_NodeCanvas.CreateInstance <VS_NodeCanvas>(); this.previousPosition = position; if (initShader == null) { // TODO: New menu etc //CreateOutputNode(); } else { //currentShaderAsset = initShader; //Load Shader...... } return(true); }
private void Splitter_DragStart(DraggableSeparator sender, double x, double y) { _splitterStartDragWidth = ColumnTree.Width; }