SaomiaoView.cs 1016 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class SaomiaoView : MonoBehaviour {
  6. [SerializeField]
  7. private Button btn;
  8. void Start () {
  9. MessageCenterController.Instance.Register(GameEnum.MESSAGE_VUFORIA_SYNC_POS, Refresh);
  10. }
  11. private void Update()
  12. {
  13. btn.gameObject.SetActive(GamePlayerData.Instance.IsInRoom);
  14. }
  15. private void OnDestroy()
  16. {
  17. MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_VUFORIA_SYNC_POS, Refresh);
  18. }
  19. private void Refresh(System.Object datas)
  20. {
  21. Transform trans = datas as Transform;
  22. //ExperimentUIManager.Instance.UIParentPoint.transform.rotation = trans.rotation;
  23. //ExperimentUIManager.Instance.UIParentPoint.transform.position = trans.position;
  24. UIParentPoint.Instance.transform.rotation = trans.rotation;
  25. UIParentPoint.Instance.transform.position = trans.position;
  26. }
  27. }