ドキュメント

Unity Engine

Unity Engine

Distance

Calculates the distance between two given vectors.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

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

Distance(Vector3Int, Vector3Int)

Calculates the distance between two given vectors.
public static float Distance(Vector3Int a, Vector3Int b)

Parameters

The first vector to check.

The second vector to check.

Returns

Type

Description

floatThe distance between
a
and
b
.

Remarks

Vector3Int.Distance(a,b)
is the same as
(a-b).magnitude
.

Distance(Vector3Int, Vector3Int)

Calculates the distance between two given vectors.
public static float Distance(in Vector3Int a, in Vector3Int b)

Parameters

The first vector to check.

The second vector to check.

Returns

Type

Description

floatThe distance between
a
and
b
.

Remarks

Vector3Int.Distance(a,b)
is the same as
(a-b).magnitude
.