//Weapon reloading speed decided by reloading speed. private IEnumerator WaitReloading() { if (OnReload != null) { OnReload(); } LoadSound(998, m_tGunPos); yield return(new WaitForSeconds(CurrentWeaponInfo.ReloadSpeed)); CurBehaviors.Reload(); if (OnReloadEnd != null) { OnReloadEnd(); } m_bReloading = false; yield break; }
//Weapon's cooling after shooting, it's time decide by shooting rate private IEnumerator WaitCooling() { CurEffect.SetActive(true); LoadSound(_CurrentWeapon * 10 + 2, m_tGunPos); yield return(new WaitForSeconds(0.2f)); CurBehaviors.Shot(m_tGunPos, m_fSpreadIncrease, m_player); if (OnFire != null) { OnFire(); } yield return(new WaitForSeconds(CurrentWeaponInfo.FireRate)); m_bShooting = true; m_fSpreadIncrease += CurrentWeaponInfo.Spread_Increase_per_shot; yield break; }