Access the x
or y
component using [0] or [1] respectively.
var p : Vector2; p[1] = 5; // the same as p.y = 5
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Vector2 p; void Example() { p[1] = 5; } }
Did you find this page useful? Please give it a rating: