Vector3
- Angle
- ClampMagnitude
- Cross
- Distance
- Dot
- forward
- Lerp
- magnitude
- Max
- Min
- MoveTowards
- normalized
- Normalize
- one
- operator !=
- operator *
- operator +
- operator -
- operator /
- operator ==
- OrthoNormalize
- Project
- Reflect
- right
- RotateTowards
- Scale
- Slerp
- SmoothDamp
- sqrMagnitude
- this [int index]
- ToString
- up
- Vector3
- x
- y
- zero
- z
Vector3.this [int index] 操作索引
var this[index : int] : float
Description描述
Access the x, y, z components using [0], [1], [2] respectively.
使用[0], [1], [2]分别访问组件x, y, z组件。简单来说就是用索引号代替x, y, z组件。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Vector3 p;
public void Awake() {
p[1] = 5;
}
}
var p : Vector3;
//等同于p.y = 5
p[1] = 5;
最后修改:2010年12月19日 Sunday 20:27