Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetVertexAttributeOffset(VertexAttribute)

Gets the offset within a vertex buffer stream of a given vertex data attribute on this MeshData.
Read time 1 minuteLast updated 9 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public int GetVertexAttributeOffset(VertexAttribute attr)

Parameters

The vertex data attribute to check for.

Returns

Type

Description

intThe byte offset within a atream of the data attribute, or -1 if it is not present.

Remarks

Meshes usually use a single vertex buffer stream, but it is possible to set up a vertex layout where attributes use different vertex buffers (see Mesh.MeshData.SetVertexBufferParams). When you use such a layout, use this function to query where a given attribute is located in a stream.
Note that this function returns the byte offset within a stream, without specifying which stream. To identify the stream that contains a given attribute, use Mesh.MeshData.GetVertexAttributeStream.