void Update() { if (_canMove) { if ((Input.GetAxis($"Fire1_{PlayerId}") > 0)) { shootable.Shoot(); } } }
protected override void Fire1Release() { charging = false; if (chargeSize > chargeThreshold) { Debug.Log($"[TouretteModule] Release Charge: Size {chargeSize}"); shootable.Shoot(chargeSize, (chargeSize / maximumCharge) / (maximumCharge / chargeSize)); } chargeSize = 0; }
void Shoot() { //make sure that the prefab orientation is preserved Quaternion ammoRotation = baseAmmoRotation; Shootable shot = (Shootable)Instantiate(loadedAmmo, transform.position, ammoRotation); //shoot in the direction the weapon is facing shot.Shoot(Vector3.Normalize(transform.forward)); ammoStorage.ConsumeAmmo(loadedAmmo.ammoType, 1); //play shooting sound if (PlayerPrefs.GetInt(PlayerPrefKeys.MUTE) != 1) { audio.Play(); } }
public void Fire(Transform owner, Transform position, IDamager damager) { Shootable.Shoot(owner, position, damager, projectileSpeed); }
protected override void Fire1Press() { Debug.Log("[TurretModule] Shoot"); shootable.Shoot(); }