Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Shooting : MonoBehaviour {
- public float ShootCooldown;
- public float CooldownCounter;
- public bool CanShoot;
- void Start () {
- CanShoot = true;
- }
- void Update () {
- if (Input.GetKeyDown (KeyCode.Mouse0) && CanShoot) {
- CanShoot = false;
- StartCoroutine (CanShootAgain ());
- }
- }
- IEnumerator CanShootAgain (){
- yield return new WaitForSeconds (1);
- CanShoot = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement