Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        shootTime += Time.deltaTime;

        if (health <= 0)
        {
            Respawn();
        }
        if (inputManager == null)
        {
            inputManager = GetComponent <PlayerInputManager>();
        }

        if (isStunned)
        {
            stunTimer += Time.deltaTime;
            if (stunTimer >= stunTime)
            {
                isStunned = false;
            }
        }
        else
        {
            if ((inputManager.GetActive()) ? inputManager.GetButtonDown(Button.Shoot) : Input.GetKeyDown(KeyCode.F))
            {
                if (shootTime >= shootTimer)
                {
                    ThrowObject();
                    shootTime = 0;
                }
            }
        }
    }
Esempio n. 2
0
        private void Update()
        {
            if (!m_player.isStunned)
            {
                if (m_inputManager == null)
                {
                    m_inputManager = GetComponent <PlayerInputManager>();
                }

                if (!m_Jump)
                {
                    m_Jump = (m_inputManager.GetActive()) ? m_inputManager.GetButtonDown(Button.Jump) : CrossPlatformInputManager.GetButtonDown("Jump");
                }
            }
            m_Character.isStunned = m_player.isStunned;
        }