|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void Input_OnEnable() { |
|
|
|
Input.touchRawProcess += ProcessRawTouch; |
|
|
|
|
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
Input.RawTouchEvent += ProcessRawTouch; |
|
|
|
#endif
|
|
|
|
public void ProcessRawTouch(Input.ProcessRawTouchesParam param) { |
|
|
|
enum TouchPhase { |
|
|
|
Began = 0, |
|
|
|
Moved = 1, |
|
|
|
Stationary = 2, |
|
|
|
Ended = 3, |
|
|
|
Canceled = 4 |
|
|
|
} |
|
|
|
|
|
|
|
void ProcessRawTouch(Input.RawTouchEventParam param) { |
|
|
|
switch (param.phase) { |
|
|
|
case 0: |
|
|
|
switch ((TouchPhase)param.phase) { |
|
|
|
case TouchPhase.Began: |
|
|
|
case 1: |
|
|
|
case TouchPhase.Moved: |
|
|
|
case 3: |
|
|
|
case TouchPhase.Ended: |
|
|
|
_wrapper.OnPointerUp(position, pointerId); |
|
|
|
break; |
|
|
|
default: |
|
|
|
|
|
|
|
|
|
|
void Input_OnDisable() { |
|
|
|
Input.touchRawProcess -= ProcessRawTouch; |
|
|
|
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
|
|
|
|
Input.RawTouchEvent -= ProcessRawTouch; |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
void Input_Update() { |
|
|
|
|
|
|
_isEntered = false; |
|
|
|
_wrapper.OnPointerLeave(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR || (!UNITY_IOS && !UNITY_ANDROID)
|
|
|
|
#if UNITY_EDITOR || (!UNITY_IOS && !UNITY_ANDROID)
|
|
|
|
#endif
|
|
|
|
#if UNITY_EDITOR || (!UNITY_IOS && !UNITY_ANDROID)
|
|
|
|
#endif
|
|
|
|
#if UNITY_EDITOR || (!UNITY_IOS && !UNITY_ANDROID)
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
#else
|
|
|
|
public void OnPointerDown(PointerEventData eventData) { |
|
|
|
} |
|
|
|
|
|
|
|
public void OnPointerUp(PointerEventData eventData) { |
|
|
|
} |
|
|
|
|
|
|
|
public void OnDrag(PointerEventData eventData) { |
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |