12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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();
- MQTTClient.Instance.SubscribeScene(id.ToString());
- });
- }
-
- // 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));
- }
- }
- }
|