Example #1
0
    private void Idle(out float movementMagnitude)
    {
        if (transform.position.x < _startPosition.x - _leftWalkLength)
        {
            _currentIdelDirection = IdleDirection.Right;
            _flipHandler.ChangeDirection(true);
        }
        else if (transform.position.x > _startPosition.x + _rightWalkLength)
        {
            _currentIdelDirection = IdleDirection.Left;
            _flipHandler.ChangeDirection(false);
        }

        _mover.Move((float)_currentIdelDirection, out movementMagnitude);
    }