public void DrawInspector(Matrix matrix, BaseMatrixWindow window) { Cell.EmptyLinePx(4); using (Cell.LineStd) Draw.DualLabel("Current Coordinate", curCoord.x + ", " + curCoord.z); using (Cell.LineStd) Draw.DualLabel("Current Value", curDefined ? curValue.ToString("0.0000f") : "Undefined"); using (Cell.LineStd) Draw.Label("Middle-click to refresh"); }
public void DrawWindow(Matrix matrix, BaseMatrixWindow window) { // DragMarkers(); // for (int r=0; r<markerRects.Length; r++) // Draw.Rect(FlipVertical(markerRects[r]), new Color(1,0,0,0.25f)); if (Event.current.button == 2) { curCoord = Coord.Floor(UI.current.mousePos.x, -UI.current.mousePos.y); if (matrix != null && matrix.rect.Contains(curCoord)) { curValue = matrix[curCoord]; curDefined = true; } else { curDefined = false; } if (curCoord != oldCurCoord) { UI.current.editorWindow.Repaint(); oldCurCoord = curCoord; } } }
public void DrawInspector(Matrix matrix, BaseMatrixWindow basewindow) { if (!(basewindow is MatrixWindow window) || matrix == null) { return; } using (Cell.LineStd) { using (Cell.RowPx(60)) if (Draw.Button("1 - m")) { matrix.InvertOne(); } using (Cell.RowPx(60)) if (Draw.Button("m + 0.5")) { matrix.Add(0.5f); } using (Cell.RowPx(60)) if (Draw.Button("m * 2")) { matrix.Multiply(2); } } using (Cell.LineStd) { using (Cell.RowPx(60)) if (Draw.Button("-m")) { matrix.Invert(); } using (Cell.RowPx(60)) if (Draw.Button("m - 0.5")) { matrix.Add(-0.5f); } using (Cell.RowPx(60)) if (Draw.Button("m / 2")) { matrix.Multiply(0.5f); } } if (Cell.current.valChanged) { window.SetMatrix(matrix, window.name); } }
public void DrawInspector(Matrix matrix, BaseMatrixWindow window) { using (Cell.LinePx(256)) { if (slice != null && slice.arr != null && slice.arr.Length != 0) { Draw.Histogram(slice.arr, new Vector4(0, 0, 0, 0.5f), new Vector4(1, 1, 1, 0.3f)); } Draw.Grid(new Color(0, 0, 0, 0.4f), cellsNumX: 1, cellsNumY: 8); } }
public void DrawInspector(Matrix matrix, BaseMatrixWindow window) { if (matrix == null) { return; } using (Cell.LineStd) Draw.Field(matrix.rect, "Rect"); using (Cell.LineStd) Draw.Field(min, "Min Value"); using (Cell.LineStd) Draw.Field(max, "Max Value"); Cell.EmptyLinePx(4); using (Cell.LinePx(64)) { if (histogram != null && histogram.Length != 0) { Draw.Histogram(histogram, new Vector4(0, 0, 0, 0.25f), new Vector4(0, 0, 0, 0)); } Draw.Grid(new Color(0, 0, 0, 0.4f)); //background grid } }
public void DrawInspector(Matrix matrix, BaseMatrixWindow window) { if (matrix == null) { return; } using (Cell.LineStd) Draw.Field(ref margins, "Margins"); using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Asset"); using (Cell.Row) Draw.ObjectField(ref exportAsset, allowSceneObject: true); using (Cell.RowPx(60)) if (Draw.Button("Save...")) { MatrixAsset matrixAsset = new MatrixAsset(); matrixAsset.matrix = matrix; matrixAsset.RefreshPreview(); ScriptableAssetExtensions.SaveAsset(matrixAsset); } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) { //if (Draw.Button("Save...")) {} } } using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Texture"); using (Cell.Row) Draw.ObjectField(ref exportTexture, allowSceneObject: true); using (Cell.RowPx(60)) if (Draw.Button("Export") && exportTexture != null) { MatrixToTexture(matrix, ref exportTexture); } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) if (Draw.Button("Save...")) { Texture2D texture = null; MatrixToTexture(matrix, ref texture); ScriptableAssetExtensions.SaveTexture(texture); } } using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Terrain"); using (Cell.Row) Draw.ObjectField(ref exportTerrain, allowSceneObject: true); using (Cell.RowPx(60)) if (Draw.Button("Export") && exportTerrain != null) { MatrixToTerrain(matrix, exportTerrain); } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) { //if (Draw.Button("Save...")) {} } } }
public void DrawWindow(Matrix matrix, BaseMatrixWindow window) { }
public void DrawInspector(Matrix matrix, BaseMatrixWindow basewindow) { if (!(basewindow is MatrixWindow window)) { return; } using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Asset"); using (Cell.Row) Draw.ObjectField(ref importAsset, allowSceneObject: true); using (Cell.RowPx(60)) { //if (Draw.Button("Export") && exportAsset!=null) } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) { //if (Draw.Button("Save...")) {} } } using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Texture"); using (Cell.Row) Draw.ObjectField(ref importTexture, allowSceneObject: true); using (Cell.RowPx(60)) if (Draw.Button("Import") && importTexture != null) { TextureToMatrix(importTexture, ref matrix); window.SetMatrix(matrix, importTexture.name); } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) if (Draw.Button("Load...")) { Texture2D texture = ScriptableAssetExtensions.LoadAsset <Texture2D>(); if (texture != null) { TextureToMatrix(texture, ref matrix); window.SetMatrix(matrix, texture.name); } } } using (Cell.LineStd) { using (Cell.RowPx(50)) Draw.Label("Terrain"); using (Cell.Row) Draw.ObjectField(ref importTerrain, allowSceneObject: true); using (Cell.RowPx(60)) if (Draw.Button("Import") && importTexture != null) { TerrainToMatrix(importTerrain, ref matrix); window.SetMatrix(matrix, importTerrain.name); } Cell.EmptyRowPx(10); using (Cell.RowPx(60)) if (Draw.Button("Load...")) { TerrainData terrain = ScriptableAssetExtensions.LoadAsset <TerrainData>(); if (terrain != null) { TerrainToMatrix(terrain, ref matrix); window.SetMatrix(matrix, terrain.name); } } } }
public void DrawWindow(Matrix matrix, BaseMatrixWindow window) { DragSlice(matrix); Draw.Rect(FlipVertical(sliceRect), new Color(0, 1, 0, 0.3f)); }
public void DrawInspector(Matrix matrix, BaseMatrixWindow window) { using (Cell.LineStd) Draw.ToggleLeft(ref window.colorize, "Colorize"); using (Cell.LineStd) Draw.ToggleLeft(ref window.relief, "Relief"); using (Cell.LinePx(0)) { using (Cell.Row) { using (Cell.LineStd) Draw.Field(ref window.min, "Min"); using (Cell.LineStd) Draw.Field(ref window.max, "Max"); } using (Cell.RowPx(50)) if (Draw.Button("Full")) { window.min = matrixMin; window.max = matrixMax; } using (Cell.RowPx(50)) if (Draw.Button("0-1")) { window.min = 0; window.max = 1; } } Cell.EmptyLinePx(4); using (Cell.LineStd) { using (Cell.Row) Draw.Label("Zoom"); using (Cell.RowPx(40)) if (Draw.Button("0.25")) { window.Zoom = 0.25f; } using (Cell.RowPx(40)) if (Draw.Button("0.50")) { window.Zoom = 0.5f; } using (Cell.RowPx(40)) if (Draw.Button("1")) { window.Zoom = 1f; } using (Cell.RowPx(40)) if (Draw.Button("2")) { window.Zoom = 2f; } using (Cell.RowPx(40)) if (Draw.Button("4")) { window.Zoom = 4f; } if (Cell.current.valChanged) { UI.current.editorWindow.Repaint(); } } using (Cell.LineStd) { using (Cell.Row) Draw.Label("Scroll"); using (Cell.RowPx(60)) if (Draw.Button("Zero")) { window.Scroll = window.ScrollZero; } using (Cell.RowPx(60)) if (Draw.Button("Center")) { window.Scroll = window.ScrollCenter; } } using (Cell.LineStd) { using (Cell.LineStd) Draw.ToggleLeft(ref lockScrollZoom, "Lock All Windows Scroll/Zoom"); if (lockScrollZoom) { MatrixWindow[] windows = Resources.FindObjectsOfTypeAll <MatrixWindow>(); for (int w = 0; w < windows.Length; w++) { windows[w].Scroll = window.Scroll; windows[w].Zoom = window.Zoom; } } } }