Ejemplo n.º 1
0
        public virtual void OnPointerExit(PointerEventData data)
        {
            _eventPosition = _pointerEventData.position;

            _newTargetPosition   = GetWorldPosition(_eventPosition);
            _newTargetPosition   = Vector2.ClampMagnitude(_newTargetPosition - _neutralPosition, MaxRange);
            _newTargetPosition   = _neutralPosition + _newTargetPosition;
            _newTargetPosition.z = _initialZPosition;

            _dragging           = false;
            _dragEndedPosition  = _newTargetPosition;
            _dragEndedAt        = Time.time;
            _dragResetDirection = _dragEndedPosition - _neutralPosition;
            _pointerOn          = false;

            TargetAnimator.SetTrigger(_sparkAnimationParameter);
            SpringAudioSource.Play();
            SpringHapticSource.Play();
        }
Ejemplo n.º 2
0
 public void PlayHaptic(int index)
 {
     hapticSource.clip = hapticClips[index];
     hapticSource.Play();
 }