john
New Member
Posts: 4
Posts: 4
|
Post by john on Apr 24, 2016 15:39:55 GMT
Hey, I'm close to finishing my app, I have a different Master Audio in each of my scenes with different sound effects Now I just want to add 4 songs to be played without stopping everytime a new scene is loaded. (Don't destroy on load / persist thing.) Problem is if I add a 2nd Master Audio prefab with my songs and play they seem to both be removed. I would of loved to have music and sfx in seperate Audio Master but it doesnt look like I can... So I think I have to....ah man... create only 1 Master Audio prefab (in persist) and put ALL sound effects from all scenes in it and the 4 songs.... I have like 15scenes with like 200-300 sound effects...I'm just wondering if there's a way I can do this without taking me tons of time.. or an easier way to do this since I have 15 different Master Audio objects in my app.. let me know
|
|
|
Post by DarkTonic Dev on Apr 24, 2016 18:16:23 GMT
Well yes only 1 Master Audio game object at once is what you need to have. You could do it how you said, or you could use Dynamic Sound Group Creator prefabs for any Scene-specific sounds / music and only put the "common between all (or many) Scenes" songs and SFX into the Master Audio game object. It's basically a mini-Master Audio game object. I've done it both ways. Here's the docs on that: dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/DynamicSoundGroupCreators.htmAlso, you'll probably want to use the Sound Group Organizer game object to import what you want from Master Audio game objects to other Master Audio game objects and/or Dynamic Sound Group Creator game objects, so you don't have to re-enter everything by hand.
|
|
john
New Member
Posts: 4
Posts: 4
|
Post by john on Apr 25, 2016 13:59:28 GMT
Alright I tried with DynamicSoundGroupCreator. I put all music in DynamicSoundGroupCreator but couldnt find a persist option for it, I added my own little script which does "GameObject.DontDestroyOnLoad(gameObject);" Problem is as soon as I change scenes it the music stops. I don't think I can do it this way because I think MasterAudio actually plays the music (not DynamicSoundGroupCreator) and is destroyed and recreated in next scene. I tried it the other way around, putting all SFX in DynamicSoundGroupCreator and all music in MasterAudio which worked but WOW is it every annoying....since MasterAudio persists I had to remove all MasterAudio in all scenes which is ok but for... ...testing scenes individually no longer works because there is no MasterAudio gameobject in scenes unless I start from scene1... Unless I'm missing something... I'm strongly thinking to put it back the way it was with MasterAudio in each scene and just have the songs start at start of new scene. So what if the song cuts/restarts/changes between each scene.
|
|
john
New Member
Posts: 4
Posts: 4
|
Post by john on Apr 25, 2016 14:11:26 GMT
any advice or input before I do changes? I appreciate your input
|
|
|
Post by DarkTonic Dev on Apr 25, 2016 15:42:00 GMT
You did it wrong because you wrote your own script to persist the game object, and you persisted the Master Audio game object but not PlaylistController game object, which is what plays the music. Anyway, delete your script and find the checkbox "Persist Between Scenes" in the Advanced Settings of the Master Audio game object. Turning that on will persist both the MA and PC game objects. And then it should work properly. After that, do as I originally suggested and put only SFX that are common between Scenes in the MA game object, and other per-Scene stuff on the DGSC game objects. I would also suggest that if you want to be able to start at any level, you use only that persistent MA game object and put it in *every Scene*. Don't worry about the persisting one because when you progress to another scene, that one will stay and the other will be automatically detected and destroyed. Read more here: dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/BestPractices.htm
|
|
john
New Member
Posts: 4
Posts: 4
|
Post by john on Apr 25, 2016 19:04:57 GMT
yup everything works fine. thx for your time and help
|
|
|
Post by DarkTonic Dev on Apr 25, 2016 19:21:51 GMT
No problem.
|
|