Комментарии:
What about saving the value of voiumes ?? These will be lost each time the scene reloads? or
not?
Do the sliders stop working after reloading scene?
ОтветитьThank you. Very helpful video!!
ОтветитьI'm just getting started learning Unity and am about to add audio to my first solo project. I definitely would have fallen for the beginner's traps shown here. It really seems worthwhile to go the extra mile to avoid a buggy mess. Thanks for the solid info and great job on the tutorial!
ОтветитьHow can I make it so these settings persist using PlayerPrefs? I have added a save button and the values are stored correctly, in my GameManager's on Awake function I load these values, set them in the SoundMixerManager and also in my OptionsMenuUI to the sliders.
The sliders continue to be full.
I love these kind of managers! I have a 2D project template and each time I find a gem like this I work it in there. Thanks a lot!
ОтветитьNicely done. All the most important points covered.
Something I would add is that in addition to playing random clips, it’s nice also randomly setting the pitch and volume, which can give a sense that you have more asset variation.
The issue then is that destroying by clip length will not adapt to the length change from pitch adjustment. To account for this, you can set the destroy time for the spawned AudioSource to:
audioSource.clip.length/audioSource.pitch.
Hope that helps!
fantastic explanations
ОтветитьGreat Tutorial, as always.
ОтветитьI've never seen anyone instantiate and destroy AudioSource objects like that. Each of my sound managers has a single audio source mapped to an audio mixer group and I use PlayOneShot() to play sound effects. Of course that doesn't use spatial audio though so if you really want the surround sound effect I guess you need an approach similar to yours. I would probably implement object pooling though so as not create a bunch of garbage and get lag spikes.
ОтветитьFirst
Ответить