Exemplo n.º 1
0
 void TouchEnd(CrossPlatformClick click)
 {
     if (onTouchEnd != null) //if any other object is using this event
     {
         onTouchEnd(click);
     }
 }
Exemplo n.º 2
0
    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;
    }
Exemplo n.º 3
0
        public virtual void OnMoveEnd(CrossPlatformClick click)
        {
            _input                  = Vector2.zero;
            _rawInputDelta          = Vector2.zero;
            handle.anchoredPosition = Vector2.zero;

            _active = false;
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 public virtual void OnMove(CrossPlatformClick click)
 {
     OnDrag(click);
 }
Exemplo n.º 6
0
 public virtual void OnMoveStart(CrossPlatformClick click)
 {
     _active = true;
 }
Exemplo n.º 7
0
 public override void OnMoveEnd(CrossPlatformClick click)
 {
     base.OnMoveEnd(click);
     background.gameObject.SetActive(false);
 }
Exemplo n.º 8
0
 public override void OnMoveStart(CrossPlatformClick click)
 {
     base.OnMoveStart(click);
     background.anchoredPosition = ScreenPointToAnchoredPosition(click.currentPosition);
     background.gameObject.SetActive(true);
 }