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(); }
public void PlayHaptic(int index) { hapticSource.clip = hapticClips[index]; hapticSource.Play(); }