Exemple #1
0
    void Update()
    {
        DisplayAmmo();
        if (Input.GetButtonDown("Fire1") && canShoot == true)
        {
            StartCoroutine(Shoot());
        }

        if (Input.GetKeyDown(KeyCode.R))
        {
            if (ammoSlot.GetCurrentAmmo(ammoType) == ammoSlot.GetAmmoInGun(ammoType))
            {
                //do nothing
            }
            else
            {
                StartCoroutine(Reload());
            }
        }
    }