protected override void DrawPreview() { base.DrawPreview(); if (preview.polyLine?.mesh == null) { PreviewDraw.DrawGenerateMarkInWindow(PreviewStage.Blank, Vector2.zero); return; } CoordRect matrixRect = PreviewManager.heightOutputPreview?.matrix != null ? PreviewManager.heightOutputPreview.matrix.rect : new CoordRect(0, 0, 0, 0); CoordRect activeRect = PreviewManager.heightOutputPreview?.matrix != null ? PreviewManager.heightOutputPreview.activeRect : new CoordRect(0, 0, 0, 0); //height background using (Cell.Custom(ToMatrixRect(matrixRect))) { Texture2D heightTex = PreviewManager.heightOutputPreview != null ? PreviewManager.heightOutputPreview.tex : UI.current.textures.GetBlankTexture(0); Draw.MatrixPreviewTexture(heightTex, colorize: false, relief: true); } //preview itself using (Cell.Custom(ToMatrixRect(activeRect))) { if (lineTex == null) { lineTex = Resources.Load("DPUI/PolyLineTex") as Texture2D; } if (lineMat == null) { lineMat = new Material(Shader.Find("Hidden/DPLayout/PolyLine")); lineMat.SetTexture("_MainTex", lineTex); lineMat.SetColor("_Color", guiGizmoColor); lineMat.SetFloat("_Width", 1.5f); //lineMat.SetFloat("_Offset", offset); //lineMat.SetFloat("_NumPoints", numPoints-1); //lineMat.SetFloat("_Dotted", dottedSpace); } Draw.Mesh(preview.polyLine.mesh, lineMat, clip: false); } PreviewDraw.DrawGenerateMarkInWindow(preview.Stage, MatrixRect.center); if (PreviewManager.heightOutputPreview != null) { PreviewDraw.DrawGenerateMarkInWindow(PreviewManager.heightOutputPreview.Stage, MatrixRect.center); } }
protected override void DrawPreview() { base.DrawPreview(); if (preview.mesh == null) { PreviewDraw.DrawGenerateMarkInWindow(PreviewStage.Blank, Vector2.zero); return; } CoordRect matrixRect = PreviewManager.heightOutputPreview?.matrix != null ? PreviewManager.heightOutputPreview.matrix.rect : new CoordRect(0, 0, 0, 0); CoordRect activeRect = PreviewManager.heightOutputPreview?.matrix != null ? PreviewManager.heightOutputPreview.activeRect : new CoordRect(0, 0, 0, 0); //height background using (Cell.Custom(ToMatrixRect(matrixRect))) { Texture2D heightTex = PreviewManager.heightOutputPreview != null ? PreviewManager.heightOutputPreview.tex : UI.current.textures.GetBlankTexture(0); Draw.MatrixPreviewTexture(heightTex, colorize: false, relief: true); } //preview itself using (Cell.Custom(ToMatrixRect(activeRect))) { if (meshMat == null) { meshMat = new Material(Shader.Find("MapMagic/ObjectPreview")); meshMat = UI.current.textures.GetMaterial("MapMagic/ObjectPreview"); meshMat.SetColor("_Color", ObjectsPreview.guiGizmoColor); meshMat.SetColor("_BackColor", new Color(0, 0, 0, 1)); meshMat.SetFloat("_Size", 1.01f); meshMat.SetFloat("_Flip", 1); } Draw.Mesh(preview.mesh, meshMat, clip: false); } PreviewDraw.DrawGenerateMarkInWindow(preview.Stage, MatrixRect.center); if (PreviewManager.heightOutputPreview != null) { PreviewDraw.DrawGenerateMarkInWindow(PreviewManager.heightOutputPreview.Stage, MatrixRect.center); } }
protected override void DrawPreview() { base.DrawPreview(); PreviewDraw.DrawGenerateMarkInWindow(preview.Stage, MatrixRect.center); }