上海虹口龙之梦项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
570 B

using UniRx;
using UnityEngine;
using UnityEngine.UI;
public class Compass : MonoBehaviour
{
private float RotZ = 0f;
public Image UICompass;
// Start is called before the first frame update
void Start()
{
Observable.EveryLateUpdate()
.Where(_ => gameObject.activeSelf == true&&UICompass!=null)
.Subscribe(_ =>
{
RotZ = transform.eulerAngles.y + AssetManager.Instance.InitialAngle;
UICompass.transform.eulerAngles = new Vector3(0, 0, RotZ);
});
}
}