format
typescript
Vector2.Get(index)class: Vector2
description
Returns the component value at the specified index position in the current vector object.
parameter
| param_name | type | description |
|---|---|---|
| index | number | The specified index position, which can be either 0 or 1. |
reture
| type | description |
|---|---|
number | The component value at the specified index position in the current vector object. |
code example
typescript
let lhs = new Vector2(1, 2);
Debug.Log(lhs.Get(0)); // 1
Debug.Log(lhs.Get(1)); // 2