Example #1
0
    private void FixedUpdate()
    {
        if ((inputData.space || inputData.triggerRight > 0f) && isShootingEnabled)
        {
            bullet = weaponHandler.GetBullet();
            bullet.transform.position = bulletSpawnPoint.position;
            bullet.Shoot(transform.forward);

            isShootingEnabled = false;
            StartCoroutine(ActivateShootingWithDelay(coolDownTimeInSeconds));
        }

        if (Input.GetKeyDown(KeyCode.B))
        {
            weaponHandler.NextWeapon();
        }

        if (inputData.yButtonDown)
        {
            weaponHandler.NextWeapon();
        }
    }