Vector3.operator - 运算符 减法

static operator - (a : Vector3, b : Vector3) : Vector3

Description描述

Subtracts one vector from another.

一个向量减另一个向量。

Subtracts each component of b from a.

从a的对应的每个组件减b对应的每个组件。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		print(new Vector3(1, 2, 3) - new Vector3(6, 5, 4));
	}
}
// prints (-5.0,-3.0,-1.0)
print (Vector3(1,2,3) - Vector3(6,5,4));

• static operator - (a : Vector3) : Vector3

Description描述

Negates a vector.

向量求反。

Each component in the result is negated.

结果是每个组件是取它相反数。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		print(-new Vector3(1, 2, 3));
	}
}
// prints (-1.0,-2.0,-3.0)
print (-Vector3(1,2,3));
Page last updated: 2010-12-20