private void Awake() { if (instance != null) { return; } instance = this; weaponPoolerScript = new PlayerBulletPoolScript(bulletPrefab, maxAmmo); gunFireAudioSource = GetComponent <AudioSource>(); }
public PlayerBulletPoolScript(GameObject _prefab, int _size) { if (instance != null) { return; } instance = this; objectPool = new List <GameObject>(); prefab = _prefab; size = _size; GrowPool(); }
// Use this for initialization void Awake() { current = this; }