已知起始向量,修改旋转rotation
RectTransform rt = transform.GetComponent<RectTransform>();
float y = Vector3.Angle(end - transform.position, Vector3.right);
rt.eulerAngles = new Vector3(0, y, 0);
已知起始向量,修改旋转rotation
RectTransform rt = transform.GetComponent<RectTransform>();
float y = Vector3.Angle(end - transform.position, Vector3.right);
rt.eulerAngles = new Vector3(0, y, 0);