123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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<Camera>();
- rectTransform = GetComponent<RectTransform>();
- 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));
- }
- }
- }
|