Class AttributesExtensions
Bounds-checked, allocation-aware index accessors for the indexed
attribute families on Attributes (TEXCOORD_n,
COLOR_n, JOINTS_n, WEIGHTS_n).
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
public static class AttributesExtensions
Methods
GetColor(Attributes, int)
Returns COLOR_<n>'s accessor index (where n is index), or null if unset.
Declaration
public static int? GetColor(this Attributes attributes, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Color set index. |
Returns
| Type | Description |
|---|---|
| int? | Accessor index |
GetJoint(Attributes, int)
Returns JOINTS_<n>'s accessor index (where n is index), or null if unset.
Declaration
public static int? GetJoint(this Attributes attributes, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Joints set index. |
Returns
| Type | Description |
|---|---|
| int? | Accessor index |
GetTexCoord(Attributes, int)
Returns TEXCOORD_<n>'s accessor index (where n is index), or null if unset.
Declaration
public static int? GetTexCoord(this Attributes attributes, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Texture coordinates index. |
Returns
| Type | Description |
|---|---|
| int? | Accessor index |
GetTexCoordsCount(Attributes)
Returns the number of texture coordinate sets.
Declaration
public static int GetTexCoordsCount(this Attributes attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
Returns
| Type | Description |
|---|---|
| int | Number of texture coordinate sets. |
GetWeight(Attributes, int)
Returns WEIGHTS_<n>'s accessor index (where n is index), or null if unset.
Declaration
public static int? GetWeight(this Attributes attributes, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Weights set index. |
Returns
| Type | Description |
|---|---|
| int? | Accessor index |
SetColor(Attributes, int, int?)
Sets COLOR_<n>'s accessor index (where n is index). See SetTexCoord(Attributes, int, int?).
Declaration
public static void SetColor(this Attributes attributes, int index, int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Color set index. |
| int? | value |
SetJoint(Attributes, int, int?)
Sets JOINTS_<n>'s accessor index (where n is index). See SetTexCoord(Attributes, int, int?).
Declaration
public static void SetJoint(this Attributes attributes, int index, int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Joints set index. |
| int? | value |
SetTexCoord(Attributes, int, int?)
Sets TEXCOORD_<n>'s accessor index (where n is index). Lazily allocates
TexCoords and pads with null as needed.
Declaration
public static void SetTexCoord(this Attributes attributes, int index, int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Texture coordinates index. |
| int? | value |
SetWeight(Attributes, int, int?)
Sets WEIGHTS_<n>'s accessor index (where n is index). See SetTexCoord(Attributes, int, int?).
Declaration
public static void SetWeight(this Attributes attributes, int index, int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | Vertex attributes. |
| int | index | Weights set index. |
| int? | value |