Esempio n. 1
0
        void MakeMesh()
        {
            MeshData meshData;

            if (additional.isAdditional)
            {
                meshData = LineDrawer.GetMeshDataMk2(edgeCollider.points, width, additional.materialLeft, materialNum, additional.materialRight, 0);
            }
            else
            {
                meshData = LineDrawer.GetMeshData(edgeCollider.points, width, materialNum, 0);
            }

            Mesh mesh = meshData.GetMesh(meshRenderer.sharedMaterials.Length);

            if (meshFilter.sharedMesh != null)
            {
                DestroyImmediate(meshFilter.sharedMesh);
            }
            meshFilter.mesh = mesh;
        }