コード例 #1
0
    //////////////////////////////////////////////
    public IEnumerator ShotSound()
    {
        SecondaryWeaponAudioSource.Stop();
        PrimaryWeaponAudioSource.Play();
        yield return(new WaitForSeconds(Clip_Shot.length));

        SecondaryWeaponAudioSource.Play();
    }
コード例 #2
0
    } /////

    public void Reload()
    {
        //if (reserveAmmo > 0 && currentWeaponState == State.Ready && currentAmmo < maxAmmoCapacity)
        if ((reserveAmmo > 0 && currentAmmo < maxAmmoCapacity) &&
            (currentWeaponState != State.Reloading && currentWeaponState != State.Switching))
        {
            StopAllCoroutines();
            currentWeaponState = State.Reloading;
            SecondaryWeaponAudioSource.Stop(); ///////////////////////////////////////////////
            StartCoroutine(ReloadCoroutine());
        }
    } /////