Mathf.DeltaAngle()

作者:追风剑情 发布于:2017-7-27 16:02 分类:Unity3d

计算当前角度转到目标角度的最小旋转角度

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        Debug.Log(Mathf.DeltaAngle(1080, 90));
        Debug.Log(Mathf.DeltaAngle(180, 720));
    }
}

运行测试

111111.png

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号