public void DrawLine(Pair2D pair) { Mesh meshBorder = Slicer2DVisualsMesh.Linear.GenerateMesh(pair, transform, lineWidth * 2f * visualScale, zPosition + 0.001f, 0, lineWidth * 2f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount); Mesh mesh = Slicer2DVisualsMesh.Linear.GenerateMesh(pair, transform, lineWidth * visualScale, zPosition, 0, lineWidth * 2f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount); lineMaterial.SetColor(Color.black); Max2DMesh.Draw(Slicer2DVisualsMesh.Linear.GenerateMesh(new Pair2D(pair.A, pair.A), transform, lineWidth * 10f * visualScale, zPosition + 0.001f, 0, lineWidth * 10f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount), lineMaterialBorder.material); Max2DMesh.Draw(Slicer2DVisualsMesh.Linear.GenerateMesh(new Pair2D(pair.B, pair.B), transform, lineWidth * 10f * visualScale, zPosition + 0.001f, 0, lineWidth * 10f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount), lineMaterialBorder.material); Max2DMesh.Draw(meshBorder, lineMaterialBorder.material); lineMaterial.SetColor(slicerColor); Max2DMesh.Draw(Slicer2DVisualsMesh.Linear.GenerateMesh(new Pair2D(pair.A, pair.A), transform, lineWidth * 5f * visualScale, zPosition + 0.001f, 0, lineWidth * 5f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount), lineMaterial.material); Max2DMesh.Draw(Slicer2DVisualsMesh.Linear.GenerateMesh(new Pair2D(pair.B, pair.B), transform, lineWidth * 5f * visualScale, zPosition + 0.001f, 0, lineWidth * 5f * visualScale, visuals.lineEndingType, visuals.lineEndingEdgeCount), lineMaterial.material); Max2DMesh.Draw(mesh, lineMaterial.material); }
public Material GetStaticMaterial() { if (material == null) { material = MaterialManager.GetVertexLitCopy(); material.SetColor(Color.black); } return(material.material); }
public SmartMaterial GetStaticMaterial() { if (staticMaterial == null || staticMaterial.material == null) { staticMaterial = MaterialManager.GetVertexLitCopy(); staticMaterial.SetColor(Color.black); } return(staticMaterial); }
public SmartMaterial GetStaticMaterial() { if (staticMaterial == null || staticMaterial.material == null) { staticMaterial = Utilities.MaterialManager.GetVertexLitCopy(); staticMaterial.SetColor(Color.black); //staticMaterial.color = ("_Emission", Color.black); } return(staticMaterial); }
public Material GetFillMaterial() { if (customMaterial) { return(customFillMaterial); } else { if (fillMaterial == null) { fillMaterial = MaterialManager.GetVertexLitCopy(); } fillMaterial.SetColor(slicerColor); return(fillMaterial.material); } }
public Material GetBorderMaterial() { if (customMaterial) { return(customBoarderMaterial); } else { if (boarderMaterial == null) { boarderMaterial = MaterialManager.GetVertexLitCopy(); } boarderMaterial.SetColor(Color.black); return(boarderMaterial.material); } }
public void Draw(Pair2D pair) { Mesh2DMesh trianglesList = new Mesh2DMesh(); trianglesList.Add(Max2DMesh.CreateLine(pair, new Vector3(1, 1, 1), lineWidth, transform.position.z + lineOffset)); Mesh mesh = Max2DMesh.Export(trianglesList); if (customColor) { material.SetColor(color); Max2DMesh.Draw(mesh, GetMaterial().material); } else { Max2DMesh.Draw(mesh, GetStaticMaterial().material); } }