public IVertex SetUv(int uvIndex, ITexCoord?uv) { if (uv != null) { this.Uvs ??= new SparseVertexAttributeArray <ITexCoord>(); this.Uvs[uvIndex] = uv; } else { this.Uvs?.Set(uvIndex, null); if (this.Uvs?.Count == 0) { this.Uvs = null; } } return(this); }
public IVertex SetColor(int colorIndex, IColor?color) { if (color != null) { this.Colors ??= new SparseVertexAttributeArray <IColor>(); this.Colors[colorIndex] = color; } else { this.Colors?.Set(colorIndex, null); if (this.Colors?.Count == 0) { this.Colors = null; } } return(this); }