private void Fire() { if (Input.GetKey("space")) { BM.Fire(weaponSelected, Vertical); } }
// Update is called once per frame void Update() { timer -= Time.deltaTime; if (timer < 0) { BulletManager.Fire("Skele_Bullet", transform.position, 270f, 5); timer = 1f; } }
void FireGun() { if (CanFireGun) { CanFireGun = false; BulletManager.Fire("Player_Bullet", ShootPoint.position, 90f, 20); Invoke("RefreshGun", GunCooldown); } }
private void Fire() { _bulletManager.Fire( _barrel.position + _barrel.forward * 12f, _barrel.rotation, (_barrel.forward + Random.insideUnitSphere * _shotScattering) * _force ); _shotSound.Play(); }
// Update is called once per frame void FixedUpdate() { timer -= Time.deltaTime; if (timer <= 0) { for (int i = 0; i < 10; ++i) { float angle = 360f * i / 10f + 2 * count; BulletManager.Fire("Skele_Bullet", (Vector2)transform.position + new Vector2((count % 5) * Mathf.Cos(Mathf.Deg2Rad * angle), (count % 5) * Mathf.Sin(Mathf.Deg2Rad * angle)), angle + 45, 2f); } ++count; timer = 0.1f; } }