Пример #1
0
        private PlayAudioAndDisable GetOneShotObject()
        {
            PlayAudioAndDisable audioObj = null;

            if (_poolingController == null)
            {
                audioObj = Instantiate(_audioPrefab).GetComponent <PlayAudioAndDisable>();
                audioObj.SetDestroyWhenDone(true);
            }
            else
            {
                audioObj = _poolingController.GetPooledObject(_audioPrefab).GetComponent <PlayAudioAndDisable>();
            }

            return(audioObj);
        }
Пример #2
0
 public void CreateObjectFromPool(GameObject prefab, Vector3 pos)
 {
     _auxGO = _poolingController.GetPooledObject(prefab);
     _auxGO.transform.position = pos;
     _auxGO.SetActive(true);
 }