public void RemoveTouchListener(OnTouchDelegate onTouchDelegate, SGTouchPhase phase) { switch (phase) { case SGTouchPhase.Began: { if (_onTouchBegan != null) { _onTouchBegan -= onTouchDelegate; } } break; case SGTouchPhase.Stationary: { if (_onTouchStationary != null) { _onTouchStationary -= onTouchDelegate; } } break; case SGTouchPhase.End: { if (_onTouchEnd != null) { _onTouchEnd -= onTouchDelegate; } } break; } }
public void Reset() { _fingerId = -1; Phase = SGTouchPhase.None; Position = Vector2.zero; _instanceId = -1; }
public void AddTouchListener(OnTouchDelegate onTouchDelegate, SGTouchPhase phase) { switch (phase) { case SGTouchPhase.Began: { _onTouchBegan += onTouchDelegate; } break; case SGTouchPhase.Stationary: { _onTouchStationary += onTouchDelegate; } break; case SGTouchPhase.End: { _onTouchEnd += onTouchDelegate; } break; } }
public void ConvertSGTouch(TouchPhase phase, Vector2 pos) { Phase = ConverTouchPhase(phase); Position = pos; }
public void ConvertSGTouch(Touch touch) { Phase = ConverTouchPhase(touch.phase); Position = touch.position; }