Version: 2020.1
public float this[int] ;

描述

分别使用 [0]、[1]、[2]、[3] 访问 x、y、z、w 分量。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { Quaternion p = new Quaternion(); p[3] = 0.5f; // the same as p.w = 0.5 } }