Exemplo n.º 1
0
        public AudioFactoryPooled(MonoBehaviour coroutineHandle, GameObject audioPrefab)
        {
            this.coroutineHandler = coroutineHandle;
            var gameObjectWithAudio = new AudioSourceGameObjectAdaptor(this, coroutineHandler);

            pool = new AudioSourcePooler(gameObjectWithAudio, this, coroutineHandler);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public IAudio CreateAudioSource()
        {
            var gameObjectWithAudioSource = GameObject.Instantiate(prefabWithAudioSource.gameObject, prefabWithAudioSource.transform.parent);
            //gameObjectWithAudioSource.transform.parent = prefabWithAudioSource.transform.parent;
            IAudio audio = new AudioSourceGameObjectAdaptor(this, coroutineHandler, gameObjectWithAudioSource);

            audio.SetAudioPosition(gameObjectWithAudioSource.transform.localPosition);
            return(audio);
        }