C# Class UnityEngine.ProBuilder.ProBuilderMesh

Inheritance: MonoBehaviour
Exibir arquivo Open project: Mertiq/Unity-Learning Class Usage Examples

Private Properties

Property Type Description
GetUVs ReadOnlyCollection
InvalidateCaches void
InvalidateFaces void
InvalidateSharedTextureLookup void
InvalidateSharedVertexLookup void
SetSharedTextures void
SetSharedVertices void

Public Methods

Method Description
GetColors ( ) : Color[]

Get an array of Color values from the mesh.

GetNormals ( ) : Vector3[]
GetTangents ( ) : Vector4[]

Get the tangents applied to the mesh, or create and cache them if not yet initialized.

GetUVs ( int channel, List uvs ) : void

Copy values in a UV channel to uvs.

GetVertices ( IList indexes = null ) : UnityEngine.ProBuilder.Vertex[]

Creates a new array of vertices with values from a @"UnityEngine.ProBuilder.ProBuilderMesh" component.

HasArrays ( MeshArrays channels ) : bool

Check if the mesh contains the requested arrays.

SetUVs ( int channel, List uvs ) : void

Set the mesh UVs per-channel. Channels 0 and 1 are cast to Vector2, where channels 2 and 3 are kept Vector4.

Does not apply to mesh (use Refresh to reflect changes after application).

SetVertices ( IList vertices, bool applyMesh = false ) : void

Set the vertex element arrays on this mesh.

Private Methods

Method Description
GetUVs ( int channel ) : ReadOnlyCollection
InvalidateCaches ( ) : void
InvalidateFaces ( ) : void
InvalidateSharedTextureLookup ( ) : void
InvalidateSharedVertexLookup ( ) : void
SetSharedTextures ( IEnumerable indexes ) : void
SetSharedVertices ( IEnumerable indexes ) : void

Set the sharedIndexes array for this mesh with a lookup dictionary.

Method Details

GetColors() public method

Get an array of Color values from the mesh.
public GetColors ( ) : Color[]
return Color[]

GetNormals() public method

public GetNormals ( ) : Vector3[]
return Vector3[]

GetTangents() public method

Get the tangents applied to the mesh, or create and cache them if not yet initialized.
public GetTangents ( ) : Vector4[]
return Vector4[]

GetUVs() public method

Copy values in a UV channel to uvs.
public GetUVs ( int channel, List uvs ) : void
channel int The index of the UV channel to fetch values from. The valid range is `{0, 1, 2, 3}`.
uvs List A list that will be cleared and populated with the UVs copied from this mesh.
return void

GetVertices() public method

Creates a new array of vertices with values from a @"UnityEngine.ProBuilder.ProBuilderMesh" component.
public GetVertices ( IList indexes = null ) : UnityEngine.ProBuilder.Vertex[]
indexes IList An optional list of indexes pointing to the mesh attribute indexes to include in the returned Vertex array.
return UnityEngine.ProBuilder.Vertex[]

HasArrays() public method

Check if the mesh contains the requested arrays.
public HasArrays ( MeshArrays channels ) : bool
channels MeshArrays A flag containing the array types that a ProBuilder mesh stores.
return bool

SetUVs() public method

Set the mesh UVs per-channel. Channels 0 and 1 are cast to Vector2, where channels 2 and 3 are kept Vector4.
Does not apply to mesh (use Refresh to reflect changes after application).
public SetUVs ( int channel, List uvs ) : void
channel int The index of the UV channel to fetch values from. The valid range is `{0, 1, 2, 3}`.
uvs List The new UV values.
return void

SetVertices() public method

Set the vertex element arrays on this mesh.
public SetVertices ( IList vertices, bool applyMesh = false ) : void
vertices IList The new vertex array.
applyMesh bool An optional parameter that will apply elements to the MeshFilter.sharedMesh. Note that this should only be used when the mesh is in its original state, not optimized (meaning it won't affect triangles which can be modified by Optimize).
return void