TestInteractive.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using RayNeo.Native;
  5. public class TestInteractive : MonoBehaviour
  6. {
  7. [SerializeField]
  8. private GameObject TestImage;
  9. [SerializeField]
  10. private GameObject TestCube;
  11. private void Start()
  12. {
  13. MercuryEventTriggerListener.Get(TestImage).OnPointEnter += OnPointerEnterImage;
  14. MercuryEventTriggerListener.Get(TestImage).OnPointExit += OnPointerExitImage;
  15. MercuryEventTriggerListener.Get(TestImage).OnPointClick += OnPointerClickImage;
  16. GlobalMgrUtil.Instance.StartInternetDetection();
  17. //GlobalMgrUtil.Instance.IsInternetUnAvailable += IsInternetUnAvailable;
  18. }
  19. private void OnPointerEnterImage(GameObject go)
  20. {
  21. Debug.Log("[MercuryX2] " + go.name + ":OnPointerEnter");
  22. }
  23. private void OnPointerExitImage(GameObject go)
  24. {
  25. Debug.Log("[MercuryX2] " + go.name + ":OnPointerExit");
  26. }
  27. private void OnPointerClickImage(GameObject go)
  28. {
  29. Debug.Log("[MercuryX2] " + go.name + ":OnPointerClick");
  30. }
  31. public void OnPointerEnter()
  32. {
  33. Debug.Log("[MercuryX2] Cube:OnPointerEnter");
  34. }
  35. public void OnPointerExit()
  36. {
  37. Debug.Log("[MercuryX2] Cube:OnPointerExit");
  38. }
  39. public void OnPointerClick()
  40. {
  41. Debug.Log("[MercuryX2] Cube:OnPointerClick");
  42. }
  43. private void IsInternetUnAvailable(bool IsAvilable)
  44. {
  45. if (IsAvilable)
  46. {
  47. Debug.Log("[MercuryX2]:当前网络异常");
  48. }
  49. else
  50. {
  51. Debug.Log("[MercuryX2]:当前网络正常");
  52. }
  53. }
  54. }