Vector2 One { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Vector2.One property provides a static instance of a 2D vector where both the X and Y components are set to 1. This is useful for scenarios where a unit vector with equal components is required, such as scaling operations or initializing vectors to a default state.

Usage

Use Vector2.One when you need a vector with both components set to 1. This can be particularly useful in mathematical operations where a uniform scale or offset is needed.

Example

// Example of using Vector2.One
Vector2 unitVector = Vector2.One;

// This will output: (1, 1)
Debug.Log($"Unit Vector: {unitVector}");