void TouchEnd(CrossPlatformClick click) { if (onTouchEnd != null) //if any other object is using this event { onTouchEnd(click); } }
void SetTouch() { if (inputX.SetInputs()) { _click = inputX.GetInput(0); if (_click.phase == IPhase.Began) { TouchStarted(_click); } else if (_click.phase == IPhase.Moved || _click.phase == IPhase.Stationary) { TouchProceed(_click); } else { TouchEnd(_click); } isMO = true; return; } isMO = false; }
public virtual void OnMoveEnd(CrossPlatformClick click) { _input = Vector2.zero; _rawInputDelta = Vector2.zero; handle.anchoredPosition = Vector2.zero; _active = false; }
protected virtual void OnDrag(CrossPlatformClick click) { _rawInputDelta = click.delta; // Vector2 position = RectTransformUtility.WorldToScreenPoint(cam, background.position); _input = (ScreenPointToAnchoredPosition(click.currentPosition) - background.anchoredPosition) / (radius * _canvas.scaleFactor); HandleInput(_input.magnitude, _input.normalized); handle.anchoredPosition = _input * radius * handleRange; }
public virtual void OnMove(CrossPlatformClick click) { OnDrag(click); }
public virtual void OnMoveStart(CrossPlatformClick click) { _active = true; }
public override void OnMoveEnd(CrossPlatformClick click) { base.OnMoveEnd(click); background.gameObject.SetActive(false); }
public override void OnMoveStart(CrossPlatformClick click) { base.OnMoveStart(click); background.anchoredPosition = ScreenPointToAnchoredPosition(click.currentPosition); background.gameObject.SetActive(true); }