Version: 2023.1

Mathf.DeltaAngle

切换到手册
public static float DeltaAngle (float current, float target);

参数

current The current angle in degrees.
target The target angle in degrees.

返回

float A value between -179 and 180, in degrees.

描述

Calculates the shortest difference between two angles.

using UnityEngine;

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