private void SetAmmo(AmmoPooling ammo) { var r = ammo.Next(); r.transform.SetPositionAndRotation(transform.position, transform.rotation); r.transform.Rotate(0, 0, Random.Range(-3f, 4f)); r.SetActive(true); }
void Start() { _bullets = new AmmoPooling(50, projectiles[(int)ProjectileType.bullet]); _grenades = new AmmoPooling(50, projectiles[(int)ProjectileType.grenade]); _rockets = new AmmoPooling(50, projectiles[(int)ProjectileType.rocket]); currentWeaponName = weapons[3].name; _shot = GetComponent <AudioSource>(); }
private void Awake() { instance = this; }
private void Awake() { Pool = FindObjectOfType <AmmoPooling>(); Stats = FindObjectOfType <PlayerStats>(); }