this[]
Access the x, y, z, w components using [0], [1], [2], [3] respectively.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
this[int]
public float this[int index] { readonly get; set; }
Parameters
Returns
Type | Description |
|---|---|
| float |
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { Vector4 p = new Vector4(); p[3] = 5; // the same as p.w = 5 }}