Vector4.this [int index] 操作索引
var this[index : int] : float
Description描述
Access the x, y, z, w components using [0], [1], [2], [3] respectively.
使用[0], [1],[2],[3]分别访问x, y, z,w组件。
C#
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour {public Vector4 p;public void Awake() {p[3] = 5;}}
var p : Vector4;p[3] = 5; // the same as p.w = 5// 等同于 p.w = 5