Version: 2017.2
public static float LerpAngle (float a, float b, float t);

描述

Lerp 相同,但是在值环绕 360 度时确保值正确插入。

参数 t 限制在范围 [0, 1] 内。假设变量 ab 以度为单位。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float minAngle = 0.0F; public float maxAngle = 90.0F; void Update() { float angle = Mathf.LerpAngle(minAngle, maxAngle, Time.time); transform.eulerAngles = new Vector3(0, angle, 0); } }

另请参阅:Lerp