lx
New Member
Posts: 5
Posts: 5
|
Post by lx on Sept 20, 2016 23:00:03 GMT
I have the MasterAudio & music playlist "menuMusic" playing in the Main Menu. I have it set so the options menu has a music button when you click it turns the playlist on/off using the PlaylistController as an OnClick() action and choosing Mute and Unmute for the buttons. It works when it first loads and also has persistent turned on - so it plays music in other scenes.
Problem is, if I turn the music off in the main menu (the first time it loads), change scenes and go back to the main menu, the buttons no longer work and do not affect the MasterAudio. Need to figure out how to have the buttons affect the audio from another scene that is persistent. I can see it turn on/off when it first loads, but switching scenes, seems to cause some disconnect.
|
|
|
Post by DarkTonic Dev on Sept 21, 2016 0:33:20 GMT
Could you put together a sample project that demonstrates the problem and send it to me please?
And let me know what to click to cause the problem.
Oh and do you get any messages in the console when it fails?
|
|
lx
New Member
Posts: 5
Posts: 5
|
Post by lx on Sept 21, 2016 22:29:18 GMT
Could you put together a sample project that demonstrates the problem and send it to me please? And let me know what to click to cause the problem. Oh and do you get any messages in the console when it fails? My project is over 1gig big, mostly done so I'm not sure how to cut it out of there. I have persistent turned on and only stops working after I go to a new room. No hard error messages, just 2 warnings when it goes back into the Main Menu. More than one Playlist Controller prefab exists in this Scene with the same name. Destroying the one called 'PlaylistController'. You may wish to set up a Bootstrapper Scene so this does not occur. UnityEngine.Debug:Log(Object) DarkTonic.MasterAudio.PlaylistController:Awake() (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:170) More than one Master Audio prefab exists in this Scene. Destroying the newer one called 'MasterAudio'. You may wish to set up a Bootstrapper Scene so this does not occur. UnityEngine.Debug:Log(Object) DarkTonic.MasterAudio.MasterAudio:Awake() (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:513) Acts as if the playlist loses control from the buttons after going into a different scene. Using Mute/Unmute in PlaylistController for OnClick();. Works fine first time in the room.
|
|
|
Post by DarkTonic Dev on Sept 21, 2016 23:52:29 GMT
Could you put together a sample project that demonstrates the problem and send it to me please? And let me know what to click to cause the problem. Oh and do you get any messages in the console when it fails? My project is over 1gig big, mostly done so I'm not sure how to cut it out of there. I have persistent turned on and only stops working after I go to a new room. No hard error messages, just 2 warnings when it goes back into the Main Menu. More than one Playlist Controller prefab exists in this Scene with the same name. Destroying the one called 'PlaylistController'. You may wish to set up a Bootstrapper Scene so this does not occur. UnityEngine.Debug:Log(Object) DarkTonic.MasterAudio.PlaylistController:Awake() (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:170) More than one Master Audio prefab exists in this Scene. Destroying the newer one called 'MasterAudio'. You may wish to set up a Bootstrapper Scene so this does not occur. UnityEngine.Debug:Log(Object) DarkTonic.MasterAudio.MasterAudio:Awake() (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:513) Acts as if the playlist loses control from the buttons after going into a different scene. Using Mute/Unmute in PlaylistController for OnClick();. Works fine first time in the room. What stops working exactly? Those warnings are expected. That just means that the non-persistent prefabs in those Scenes will not be used, but destroyed the instant you enter the Scene. Did you understand that part or did you think it would be using the others?
|
|
|
Post by DarkTonic Dev on Sept 22, 2016 1:38:28 GMT
What code or script are you using for the mute / unmute button? Can you show either the settings (Inspector) or code please? Not sure if you are doing a "persistent mute" or other type.
It will make a difference if when I go to try and reproduce your setup. I'm pretty sure EventSounds script can do this for you if you aren't already using it for this.
|
|
|
Post by DarkTonic Dev on Sept 22, 2016 3:39:50 GMT
I tried to reproduce the problem and could not. I was using the line of code:
MasterAudio.ToggleMutePlaylist();
If I can't reproduce it, I can't fix it. You might try to make a tiny project that does nothing other than this (change scenes / mute) and see if it still happens, because you can send that to me if it does.
|
|
lx
New Member
Posts: 5
Posts: 5
|
Post by lx on Sept 22, 2016 19:03:00 GMT
What code or script are you using for the mute / unmute button? Can you show either the settings (Inspector) or code please? Not sure if you are doing a "persistent mute" or other type. It will make a difference if when I go to try and reproduce your setup. I'm pretty sure EventSounds script can do this for you if you aren't already using it for this. The Mute/Unmute or even StartPlaylist/PausePlaylist do not work anymore after I change to a new scene. I've also tried the "ToggleMutePlaylist" which works too - but only on the first load of the scene. 1. 1st time scene loads - able to Mute/Unmute Music in the PlaylistController using the PlaylistController Mute/Umute in the OnClick() action of the button. 1st time loaded - works as intended. Persistent is turned on so music plays in all the scenes 2. Click a button that takes me to a different scene - click the button to take me back to the Main Menu scene 3. Back in the Main Menu - clicking the Mute/Unmute button no longer works. Does not look like the command affects the Playslist controller anymore I've added a screenshot and labeled the 3 areas... 1. Buttons that Mute/Unmute 2. InGame - where the Mute Button is 3. Inspector - OnClick for the button, uses the PlaylistController code Whenever the scene changes, that is when you can no longer have the Mute/Unmute work. Music just continues to play and when I click the button, it's as if it doesn't affect the MasterAudio playlist anymore.
|
|
lx
New Member
Posts: 5
Posts: 5
|
Post by lx on Sept 22, 2016 19:20:09 GMT
UPDATE: Ok - it looks like if I take the PlaylistController out of the "OnClick()" in the inspector and just add the Event Sounds to the button - using that to toggle music "ToggleMusicPlaylist", that seems to work with persistent scenes. If anyone out there is having a similar issue - this fixed mine.
|
|
|
Post by DarkTonic Dev on Sept 22, 2016 19:22:29 GMT
Ok cool!
|
|