ドキュメント

Unity Engine


User Manual

Script Reference

Unity Engine


Distance

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

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
.