Vector4.operator -   运算符 减法


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

Description描述

Subtracts one vector from another.

一个向量减去另一个向量

Subtracts each component of b from a.  

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

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(new Vector4(1, 2, 3, 4) - new Vector4(6, 5, 4, 3));}}
// prints (-5.0,-3.0,-1.0,1.0)print (Vector4(1,2,3,4) - Vector4(6,5,4,3));

• static operator - (a : Vector4) : Vector4

Description描述

Negates a vector.

向量求反。

Each component in the result is negated.  

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

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(-new Vector4(1, 2, 3, 4));}}
// prints (-1.0,-2.0,-3.0,-4.0)print (-Vector4(1,2,3,4));


,