private int zRotation;
public GameObject obj;
public void Update()
{
//obj = GameObject.Find("Camera"); //获取名为Camera的相机对象
zRotation = player.transform.eulerAngles.y; //player是unity第一人称
compass.transform.eulerAngles = new Vector3(0, 0, zRotation); //改变image的Z轴rotation
}
时间: 2024-10-03 14:55:29