Exemple #1
0
        internal static ProBuilderMesh CreateInstanceWithPoints(Vector3[] positions)
        {
            if (positions.Length % 4 != 0)
            {
                Log.Warning("Invalid Geometry. Make sure vertices in are pairs of 4 (faces).");
                return(null);
            }

            GameObject go = new GameObject();

            go.name = "ProBuilder Mesh";
            ProBuilderMesh pb = go.AddComponent <ProBuilderMesh>();

            pb.m_MeshFormatVersion = k_MeshFormatVersion;
            pb.GeometryWithPoints(positions);

            return(pb);
        }