240 私信
这个人很懒,暂无签名信息
0

Unity比较两个向量的长度

向量的长度是用勾股定理计算出来,计算机计算两次方和开根的运算量比加减法要费时的多。所以如果是想比较两个向量的长度,用sqrMagnitude可以快出很多。using UnityEngine; using System.Collections; public class example : MonoBehaviour { public Transform other; public float...

个人介绍
暂无介绍