TextScripts.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.EventSystems;
  6. public class TextScripts : MonoBehaviour,IPointerClickHandler,IPointerEnterHandler,IPointerExitHandler
  7. {
  8. public Button btn;
  9. public void OnPointerClick(PointerEventData eventData)
  10. {
  11. string tag = eventData.pointerEnter.gameObject.tag;
  12. Debug.Log("enter Object and Begin Log"+ tag);
  13. //发送请求数据消息
  14. //SocketManager.Send(1001, dataByte);
  15. switch (tag)
  16. {
  17. case "Main":
  18. UIModule.OpenView(ViewID.Main);
  19. break;
  20. case "GF":
  21. UIModule.OpenView(ViewID.RY);
  22. break;
  23. case "GRZQ":
  24. UIModule.OpenView(ViewID.GRZQ);
  25. break;
  26. case "GS":
  27. UIModule.OpenView(ViewID.GS);
  28. break;
  29. case "PY":
  30. UIModule.OpenView(ViewID.PY);
  31. break;
  32. case "RY":
  33. UIModule.OpenView(ViewID.RY);
  34. break;
  35. case "SGT":
  36. UIModule.OpenView(ViewID.SGT);
  37. break;
  38. case "SMQ":
  39. UIModule.OpenView(ViewID.SMQ);
  40. break;
  41. case "CYQ":
  42. UIModule.OpenView(ViewID.CYQ);
  43. break;
  44. default:
  45. GameLog.LogWarning("该模型没有绑定页面");
  46. break;
  47. }
  48. }
  49. public void OnPointerEnter(PointerEventData eventData)
  50. {
  51. //todo 打开物体高亮
  52. //发送事件弹出提示窗口
  53. HighLightManager.Instance.ControllerHighLight(gameObject, true);
  54. }
  55. public void OnPointerExit(PointerEventData eventData)
  56. {
  57. //todo 关闭高亮
  58. HighLightManager.Instance.ControllerHighLight(gameObject, false);
  59. }
  60. // Start is called before the first frame update
  61. void Start()
  62. {
  63. }
  64. // Update is called once per frame
  65. void Update()
  66. {
  67. }
  68. }