float UniformScale { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The UniformScale property of the Transform struct represents a uniform scaling factor applied to the transform. This property is a single floating-point value that is used when the scale is uniform across all axes. Typically, the x component of the scale vector is accessed to determine the uniform scale.

Usage

Use the UniformScale property when you need to apply or retrieve a uniform scale factor to a Transform object. This is useful in scenarios where the scaling is consistent across all dimensions, simplifying the manipulation of the transform's scale.

Example

// Example of setting and getting the UniformScale property

// Create a new Transform instance
Transform transform = new Transform();

// Set the uniform scale
transform.UniformScale = 2.0f;

// Retrieve the uniform scale
float scale = transform.UniformScale;

// Output the scale
// Note: Avoid using Console.WriteLine in s&box
// Instead, use the appropriate logging or debugging tools provided by the engine
// Debug.Log(scale);