|
|
|
|
|
|
void Input_OnEnable() { |
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
UnityEngine.UIWidgets.InitUIWidgets.Init(); |
|
|
|
UnityEngine.UIWidgets.RawTouchEvent += ProcessRawTouch; |
|
|
|
UnityEngine.UIWidgets.RawTouchEvent += CacheRawTouch; |
|
|
|
#endif
|
|
|
|
_inputMode = Input.mousePresent ? UIWidgetsInputMode.Mouse : UIWidgetsInputMode.Touch; |
|
|
|
} |
|
|
|
|
|
|
Stationary = 2, |
|
|
|
Ended = 3, |
|
|
|
Canceled = 4 |
|
|
|
} |
|
|
|
|
|
|
|
void CacheRawTouch(UnityEngine.UIWidgets.RawTouchEventParam param) { |
|
|
|
rawTouchEventParams.Enqueue(param); |
|
|
|
} |
|
|
|
|
|
|
|
void ProcessRawTouch(UnityEngine.UIWidgets.RawTouchEventParam param) { |
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Queue<UnityEngine.UIWidgets.RawTouchEventParam> rawTouchEventParams = |
|
|
|
new Queue<UnityEngine.UIWidgets.RawTouchEventParam>(); |
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
UnityEngine.UIWidgets.RawTouchEvent -= ProcessRawTouch; |
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
UnityEngine.UIWidgets.RawTouchEvent -= CacheRawTouch; |
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
while (rawTouchEventParams.isNotEmpty()) { |
|
|
|
ProcessRawTouch(rawTouchEventParams.Dequeue()); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
//we only process hover events for desktop applications
|
|
|
|
if (_inputMode == UIWidgetsInputMode.Mouse) { |
|
|
|
if (_isEntered) { |
|
|
|