void Update() { //Check fire control if (Input.GetButtonDown("Fire1") && CanFire && ThisInventory.CanShoot) { ThisInventory.UseAmmo(); CanFire = false; Invoke("EnableFire", ReloadDelay); } }
/* Attack to Player */ public void Attack() { if (chaseTarget != null) { if (Fire && CanFire) { ammo.UseAmmo(); CanFire = false; Invoke("EnableFire", ReloadDelay); } else if (!Fire) { chaseTarget.GetComponent <PlayerLive>().TakeDamage(Damage); } } }