标签:span nbsp target unit tar col oat tor orm
void LookAt2D(Transform target) { Vector3 dir = target.position - transform.position; float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward); }
以X轴指向的方向
标签:span nbsp target unit tar col oat tor orm
原文地址:https://www.cnblogs.com/sanyejun/p/11308332.html