Exemple #1
0
        private void equalArea(AbstractPolygon abstractPolygon1, AbstractPolygon abstractPolygon2)
        {
            if (verbose)
            {
                Debug.Log(abstractPolygon1.figName + " and " + abstractPolygon2 + " have equal areas.");
            }
            abstractPolygon1.GetComponent <MeshRenderer>().material.color = Color.green;
            abstractPolygon2.GetComponent <MeshRenderer>().material.color = Color.green;

            //also need to change textures.
        }
 public void Initialize()
 {
     myPoly = GetComponent <AbstractPolygon>();
     mesh0  = GetComponent <MeshFilter>().mesh;
     child  = new GameObject();
     child.transform.parent = this.transform.parent;
     mesh1 = child.AddComponent <MeshFilter>().mesh;
     child.AddComponent <MeshRenderer>().material = myPoly.GetComponent <MeshRenderer>().material;
     mesh1.vertices  = mesh0.vertices;
     mesh1.triangles = mesh0.triangles;
     mesh1.normals   = mesh0.normals;
 }