private void FVmeshVertexColor(FigureDataStruct fv) { GameObject meshInstance = BuilderFunctions.InstantiateMesh(fv.Vertices, fv.Faces, transform, fv.shootability[0], fv.id[0]); BuilderFunctions.AddMat(fv.Opacity, meshInstance, _vertexColors, _opaqueVertexColors); meshInstance.GetComponent <MeshFilter>().mesh.colors = fv.VertColorList[0]; }
private void FVmeshSingleColor(FigureDataStruct fv) { GameObject meshInstance = BuilderFunctions.InstantiateMesh(fv.Vertices, fv.Faces, transform, fv.shootability[0], fv.id[0]); BuilderFunctions.AddMat(fv.Opacity, meshInstance, _singleColor, _opaqueSingleColor); meshInstance.GetComponent <MeshRenderer>().material.SetColor("_color", fv.SingleColor); }
private void FVmeshMultiVertColor(FigureDataStruct fv) { GameObject meshInstance = BuilderFunctions.InstantiateMesh(fv.Vertices, fv.Faces, multiMeshContainer, fv.shootability[0], fv.id[0]); List <Color[]> _multiVertColorList = fv.VertColorList; multiMeshContainer.GetComponent <MultiVertColUpdater>().SetStuff(_multiVertColorList, meshInstance); meshInstance.GetComponent <MeshFilter>().mesh.colors = _multiVertColorList[0]; BuilderFunctions.AddMat(fv.Opacity, meshInstance, _vertexColors, _opaqueVertexColors); }
// matType Functions private void FVmeshSingleColor(MatNode fv) { Vector3[] vertices = DataParser.MatrixToVectorArray(fv.Fields["vertices"].GetValue <double[, ]>()); int[] faces = DataParser.MatrixTo1DArray(fv.Fields["faces"].GetValue <int[, ]>()); GameObject meshInstance = BuilderFunctions.InstantiateMesh(vertices, faces, transform); Color color = ColorParser.GetColor(fv.Fields["color"].GetValue <double[, ]>()); double[,] temp = fv.Fields["opacity"].GetValue <double[, ]>(); float opacity = (float)temp[0, 0]; BuilderFunctions.AddMat(opacity, meshInstance, _singleColor, _opaqueSingleColor); meshInstance.GetComponent <MeshRenderer>().material.SetColor("_color", color); }
private void FVmeshVertexColor(MatNode fv) { Vector3[] vertices = DataParser.MatrixToVectorArray(fv.Fields["vertices"].GetValue <double[, ]>()); int[] faces = DataParser.MatrixTo1DArray(fv.Fields["faces"].GetValue <int[, ]>()); GameObject meshInstance = BuilderFunctions.InstantiateMesh(vertices, faces, transform); double[,] temp = fv.Fields["opacity"].GetValue <double[, ]>(); float opacity = (float)temp[0, 0]; BuilderFunctions.AddMat(opacity, meshInstance, _vertexColors, _opaqueVertexColors); double[,] col = fv.Fields["colors"].GetValue <double[, ]>(); List <Color[]> vertexColorList = ColorParser.GetVertexColorList(col, fv.Fields["map"].GetValue <double[, ]>()); meshInstance.GetComponent <MeshFilter>().mesh.colors = vertexColorList[0]; }