示例#1
0
    private void Awake()
    {
        if (instance != null)
        {
            return;
        }

        instance           = this;
        weaponPoolerScript = new PlayerBulletPoolScript(bulletPrefab, maxAmmo);
        gunFireAudioSource = GetComponent <AudioSource>();
    }
示例#2
0
    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;
 }