기술 자료

Unity Engine

Unity Engine

Distance

Calculates the distance between two given vectors.
읽는 시간 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
.