Class MeshImporter
Responsible for importing UnityEngine.Mesh data to a ProBuilderMesh component.
Inheritance
System.Object
MeshImporter
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public sealed class MeshImporter
Constructors
MeshImporter(ProBuilderMesh)
Create a new MeshImporter instance.
Declaration
public MeshImporter(ProBuilderMesh target)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | target | The ProBuilderMesh component that will be initialized with the imported mesh attributes. |
Methods
Import(Mesh, Material[], MeshImportSettings)
Import mesh data from a GameObject's MeshFilter.sharedMesh and MeshRenderer.sharedMaterials.
Declaration
public void Import(Mesh originalMesh, Material[] materials = null, MeshImportSettings importSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Mesh | originalMesh | The UnityEngine.Mesh to extract attributes from. |
Material[] | materials | The materials array corresponding to the originalMesh submeshes. |
MeshImportSettings | importSettings | Optional settings parameter defines import customization properties. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Import only supports triangle and quad mesh topologies. |