Ejemplo n.º 1
0
    public void SetMovement(float distanceAdded, bool flag)
    {
        if (!_bouncingMovement.IsMovementEnded())
        {
            return;
        }

        var state           = _getPositionState();
        var movingDirection = Mathf.Sign(distanceAdded);

        if ((state == PositionState.Top && movingDirection < 0) ||
            (state == PositionState.Bottom && movingDirection > 0))
        {
            _bouncingMovement.SetMovement(movingDirection * _bouncingDeltaPos);
        }
        else
        {
            distanceAdded += _unitMovement.distanceRemaining;
            _unitMovement.SetMovement(distanceAdded);
        }
    }
Ejemplo n.º 2
0
 public bool IsMovementEnded()
 {
     return(!_isDragging &&
            _aligningMovement.IsMovementEnded() &&
            _releasingMovement.IsMovementEnded());
 }
Ejemplo n.º 3
0
 public bool IsMovementEnded()
 {
     return(_bouncingMovement.IsMovementEnded() &&
            _unitMovement.IsMovementEnded());
 }