已知起始向量,修改旋转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);
本文标题:Unity RectTransform修改rotation
本文链接:https://www.haomeiwen.com/subject/yjgdkdtx.html
网友评论