123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using RayNeo.Tool;
- using UnityEngine;
- using UnityEngine.UI;
- public class TestInput : MonoBehaviour
- {
- [SerializeField]
- private Text InputTxt;
- private void OnEnable()
- {
- TouchEventCtrl.Instance.OnTouchStart += OnTouchStart;
- TouchEventCtrl.Instance.OnTouchDown += OnTouchDown;
- TouchEventCtrl.Instance.OnTouchUp += OnTouchUp;
- TouchEventCtrl.Instance.OnSwipeLeftEnd += OnSwipeLeftEnd;
- TouchEventCtrl.Instance.OnSwipeRightEnd += OnSwipeRightEnd;
- TouchEventCtrl.Instance.OnSwipeLeft += OnSwipeLeft;
- TouchEventCtrl.Instance.OnSwipeRight += OnSwipeRight;
- TouchEventCtrl.Instance.OnSimpleTap += OnSimpleTap;
- TouchEventCtrl.Instance.OnDoubleTap += OnDoubleTap;
- TouchEventCtrl.Instance.OnTripleTap += OnTripleTap;
- TouchEventCtrl.Instance.OnLongTap += OnLongTap;
- }
- private void OnDisable()
- {
- TouchEventCtrl.Instance.OnTouchStart -= OnTouchStart;
- TouchEventCtrl.Instance.OnTouchDown -= OnTouchDown;
- TouchEventCtrl.Instance.OnTouchUp -= OnTouchUp;
- TouchEventCtrl.Instance.OnSwipeLeftEnd -= OnSwipeLeftEnd;
- TouchEventCtrl.Instance.OnSwipeRightEnd -= OnSwipeRightEnd;
- TouchEventCtrl.Instance.OnSwipeLeft -= OnSwipeLeft;
- TouchEventCtrl.Instance.OnSwipeRight -= OnSwipeRight;
- TouchEventCtrl.Instance.OnDoubleTap -= OnDoubleTap;
- TouchEventCtrl.Instance.OnSimpleTap -= OnSimpleTap;
- TouchEventCtrl.Instance.OnTripleTap -= OnTripleTap;
- TouchEventCtrl.Instance.OnLongTap -= OnLongTap;
- }
- private void OnTouchStart()
- {
- Debug.Log("[MercuryX2]:OnTouchStart");
- InputTxt.text = "OnTouchStart";
- }
- private void OnTouchDown()
- {
- Debug.Log("[MercuryX2]:OnTouchDown");
- InputTxt.text = "OnTouchDown";
- }
- private void OnTouchUp()
- {
- Debug.Log("[MercuryX2]:OnTouchUp");
- InputTxt.text = "OnTouchUp";
- }
- private void OnSwipeLeftEnd()
- {
- Debug.Log("[MercuryX2]:OnSwipeLeftEnd");
- InputTxt.text = "OnSwipeLeftEnd";
- }
- private void OnSwipeRightEnd()
- {
- Debug.Log("[MercuryX2]:OnSwipeRightEnd");
- InputTxt.text = "OnSwipeRightEnd";
- }
- private void OnSwipeLeft()
- {
- Debug.Log("[MercuryX2]:OnSwipeLeft");
- InputTxt.text = "OnSwipeLeft";
- }
- private void OnSwipeRight()
- {
- Debug.Log("[MercuryX2]:OnSwipeRight");
- InputTxt.text = "OnSwipeRight";
- }
- private void OnDoubleTap()
- {
- Debug.LogError("[MercuryX2]:OnDoubleTap");
- InputTxt.text = "OnDoubleTap";
- }
- private void OnSimpleTap()
- {
- Debug.LogError("[MercuryX2]:OnSimpleTap");
- InputTxt.text = "OnSimpleTap";
- }
- private void OnTripleTap()
- {
- Debug.LogError("[MercuryX2]:OnTripleTap");
- InputTxt.text = "OnTripleTap";
- }
- private void OnLongTap()
- {
- Debug.LogError("[MercuryX2]:OnLongTap");
- InputTxt.text = "OnLongTap";
- }
- }
|