Quaternion.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组件。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Quaternion p;
	public void Awake() {
		p[3] = 0.5F;
	}
}
var p : Quaternion;
p[3] = 0.5;
// the same as p.w = 0.5
//等同于p.w = 0.5;
Page last updated: 2011-1-15