Exemplo n.º 1
0
        public static InteractiveVertex Create(InteractiveMesh forMesh, List <Vertex> commonVerts, GameObject basePrefab = null)
        {
            GameObject intVertObj;

            if (basePrefab == null)
            {
                intVertObj = new GameObject("Interactive Vertex");
            }
            else
            {
                intVertObj = Instantiate <GameObject>(basePrefab);
            }

            intVertObj.transform.parent = forMesh.transform;
            var intVert = intVertObj.GetComponent <InteractiveVertex>() ?? intVertObj.AddComponent <InteractiveVertex>();

            intVert.intMesh = forMesh;
            intVert.SetCommonVertices(commonVerts);
            return(intVert);
        }
Exemplo n.º 2
0
        public static InteractiveFace Create(InteractiveMesh forMesh, Face face, GameObject basePrefab = null)
        {
            GameObject intFaceObj;

            if (basePrefab == null)
            {
                intFaceObj = new GameObject("Interactive Face");
            }
            else
            {
                intFaceObj = Instantiate <GameObject>(basePrefab);
            }

            intFaceObj.transform.parent        = forMesh.transform;
            intFaceObj.transform.localPosition = GetLocalFaceCenter(face);

            var intFace = intFaceObj.GetComponent <InteractiveFace>() ?? intFaceObj.AddComponent <InteractiveFace>();

            intFace.intMesh = forMesh;
            intFace.face    = face;
            return(intFace);
        }