// Update is called once per frame
    private void Update()
    {
        RotateView();
        if (CrossPlatformInputManager.GetButtonDown("Jump"))
        {
            _mouseLook.Holding = true;
            if (!_hold)
            {
                _elvenBow.Set();
                _hold             = true;
                _audioSource.loop = true;
                PlayHoldSound();
            }
        }

        if (CrossPlatformInputManager.GetButtonUp("Jump"))
        {
            _mouseLook.Holding = false;
            if (_hold)
            {
                _elvenBow.Release();
                _audioSource.loop = false;
                _audioSource.Stop();
                _hold = false;
            }
        }


        if (!_previouslyGrounded && _characterController.isGrounded)
        {
            PlayLandingSound();
        }

        _previouslyGrounded = _characterController.isGrounded;
    }
Exemple #2
0
    // Update is called once per frame
    private void Update()
    {
        if (!_controller.isActiveAndEnabled)
        {
            return;
        }

        if (!_gameStarted)
        {
            _gameStarted = true;
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (!_hold)
            {
                _elvenBow.Set();
                _hold             = true;
                _audioSource.loop = true;
                PlayHoldSound();
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            if (_hold)
            {
                _elvenBow.Release();
                _audioSource.loop = false;
                _audioSource.Stop();
                _hold = false;
            }
        }
    }