기술 자료

Unity Engine

Unity Engine

Distance

Calculates the distance between two vectors.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

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

Distance(Vector2Int, Vector2Int)

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

Parameters

The first vector to check.

The second vector to check.

Returns

Type

Description

floatThe distance between
a
and
b
.

Remarks

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

Distance(Vector2Int, Vector2Int)

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

Parameters

The first vector to check.

The second vector to check.

Returns

Type

Description

floatThe distance between
a
and
b
.

Remarks

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