Vector2 TextureScale { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The TextureScale property of the MeshFace class in the Editor.MeshEditor namespace represents the scaling factor applied to the texture coordinates of a mesh face. This property is of type Vector2, allowing for independent scaling along the U and V axes of the texture.

Usage

Use the TextureScale property to adjust how a texture is scaled across a mesh face. This can be useful for achieving the desired texture appearance, such as repeating or stretching the texture pattern.

To modify the texture scale, simply assign a new Vector2 value to the property, where each component of the vector represents the scale factor along the respective axis.

Example

// Example of setting the TextureScale property
MeshFace meshFace = new MeshFace();

// Set the texture scale to 2.0 on the U axis and 1.5 on the V axis
meshFace.TextureScale = new Vector2(2.0f, 1.5f);

// Accessing the current texture scale
Vector2 currentScale = meshFace.TextureScale;

// Output the current scale
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use appropriate logging or debugging tools
// Debug.Log($"Current Texture Scale: {currentScale}");