文档

Unity Engine

Unity Engine

operator -(Vector4, Vector4)

Subtracts one vector from another.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Operator
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static Vector4 operator -(Vector4 a, Vector4 b)

Parameters

The vector to subtract
b
from.

The vector to subtract from
a
.

Returns

Type

Description

Vector4

Remarks

Subtracts each component of
b
from
a
.

Examples

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