ドキュメント

Unity Engine

Download Unity

Unity Engine

DeltaAngle(float, float)

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

Definition

public static float DeltaAngle(float current, float target)

Parameters

current

The current angle in degrees.

target

The target angle in degrees.

Returns

Type

Description

floatA value between -180 (exclusive) and 180 (inclusive) in degrees

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { // Prints 90 Debug.Log(Mathf.DeltaAngle(1080, 90)); }}