Пример #1
0
    private void DrawOuter(List <List <ShapePoint> > outerVerticies, bool closedLoop)
    {
        Mesh mesh = MeshMaker.ExtrudeShapeMeshAlongPath(outerVerticies, "outer", closedLoop, true);

        DestroyImmediate(GameObject.Find("Outer Edge"));
        GameObject piece = new GameObject("Outer Edge");

        piece.transform.SetParent(transform);
        piece.transform.position = transform.position;
        piece.AddComponent <MeshFilter>().sharedMesh = mesh;

        MeshRenderer rend = piece.AddComponent <MeshRenderer>();

        rend.sharedMaterial       = new Material(Shader.Find("Standard"));
        rend.sharedMaterial.color = Color.white;
    }