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
}