using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UserChooseSceneItem : MonoBehaviour { public Toggle tg; //场景ID public string id; public Text itemName; public Mask mask; public Camera xrCamera; public GameObject model; public Button gotoSceneBtn; private RectTransform rectTransform; // Start is called before the first frame update void Start() { xrCamera = OpenXRCamera.Instance.GetComponent(); rectTransform = GetComponent(); gotoSceneBtn.onClick.AddListener(() => { GameManager.Instance.isShowDownTip = true; UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.download); GameScene.Instance.gotoScenes(id); DownloadResManager.Instance.StartDownLoad(); }); } // Update is called once per frame void Update() { if(mask) { //if(mask.IsRaycastLocationValid(rectTransform.position, xrCamera)) //{ // model.SetActive(true); //} //else //{ // model.SetActive(false); //} // Debug.LogError( " MASK YC "); model.SetActive(mask.IsRaycastLocationValid(rectTransform.position, xrCamera)); } } }