Skip to content

format

typescript
Vector2.Get(index)

class: Vector2

description

Returns the component value at the specified index position in the current vector object.

parameter

param_nametypedescription
indexnumberThe specified index position, which can be either 0 or 1.

reture

typedescription
numberThe 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