I have 3 little questions, that maybe you can help me out with: (working in c#)
I have a slider volume control in my menu, for the player to decide what level of music they want to have…to name it (like to say Volume Control or something like that…) it has to be with a GUI label, right?
Since I have not added any sounds into my game yet, I am asking this: even if is in the menu… and the game will have 3 or 4 scenes… it will control everything or I have to “save it” somewhere to keep working?
Is there a way (maybe you can point me out in the right direction, since I did some research and couldnt find anything) you can have one slider for your music and another one for your sfx? and if so, how can you “store” the sounds for each slider to control them?
You will need a GUI Label for the name of the volume and a GUI Slider for the value of the volume
2-3) You can use my audio plugin. It allows you to have as many volume sliders as you want.
Great daemon3000!!! Thanks a lot!. Let me bother you just a little bit longer…
Should I call the script from my options menu one? (private AudioManager _audiomanager; audiomanager = GetComponent() or how do I implement it to reach sliders from my menu?
The idea is, once the player clicks on “sound”, they have the sliders on the right side of this button, so they adjust them, and move on with the other options (and also, maybe, recheable from the pause menu)
The AudioManager class is a singleton and it’s public methods are static so you don’t need a reference to it. You need to create an AudioManager game-object in your first scene(Team Utility/Audio Manager/Create/Audio Manager) and enable "Dont Destroy On Load" in the inspector so it doesn’t get destroyed when you load other scenes. To access the volumes look at the example in the post above.
I did as you said, but I keep on receiving this error message
Assets/Menu2/Script/Options.cs(319,9): error CS0103: The name `AudioManager’ does not exist in the current context and, of course, in the c# editor, I get AudioManager in red
I got it… VS gave me the option to “link” the AudioManager to the plugin … I do have a question, tho. What do I need for the Music and SFX to be considerer like that? I mean… right now, only the master volume works, and the only music I added so far is a MP3 that is added to the main camera in the options menu with the play on awake mark checked.
Also, for the sliders to appear I had to put a GUILayout.Label, otherway they won´t show up
For an audio source to be considered Music or SFX you need need to add the MusicSource or SoundEffectSource script to the game-objects that have an AudioSource component. Alternatively you can use the Team Utility/Audio Manager/Create menu. To fix the error you recevied you need to include the namespace where the scripts are:
daemon… let me ask you: if I want to play a sound…let´s say, when I click on a button, but this sound is added to the SFXsource, how do I have to add it to keep using the AudioManager with that sound but also add it to the script I am making?
Hey, so if your using a GUI slider to control Master Volume… I created another Audio Source and then linked the Audio Source Volume to my Audio Listener with a float. Try this.