文档

Unity Engine

Unity Engine

Min

Creates a vector that is made from the smallest components of two vectors.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Min(Vector4, Vector4)

Creates a vector that is made from the smallest components of two vectors.
public static Vector4 Min(Vector4 lhs, Vector4 rhs)

Parameters

The first vector to compare.

The second vector to compare.

Returns

Type

Description

Vector4A vector that is made from the smallest components of the given vectors.

Remarks

Additional Resources: Vector4.Max function.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { Vector4 a = new Vector4(1, 2, 3, 5); Vector4 b = new Vector4(4, 3, 2, 0); print(Vector4.Min(a, b)); // prints (1.0,2.0,2.0,0.0) }}

Min(Vector4, Vector4)

Creates a vector that is made from the smallest components of two vectors.
public static Vector4 Min(in Vector4 lhs, in Vector4 rhs)

Parameters

The first vector to compare.

The second vector to compare.

Returns

Type

Description

Vector4A vector that is made from the smallest components of the given vectors.

Remarks

Additional Resources: Vector4.Max function.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { Vector4 a = new Vector4(1, 2, 3, 5); Vector4 b = new Vector4(4, 3, 2, 0); print(Vector4.Min(a, b)); // prints (1.0,2.0,2.0,0.0) }}