Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Update()
- {
- if(canShoot && currentWeapon && Input.GetMouseButton(0))
- {
- Shoot();
- }
- }
- private void Shoot()
- {
- currentWeapon.Shooting();
- StartCoroutine(ResetShoot());
- }
- private IEnumerator ResetShoot()
- {
- canShoot = false;
- yield return new WaitForSeconds(currentWeapon.weaponCooldown);
- canShoot = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment