|
Post by danosono on Oct 11, 2022 22:29:25 GMT
Hello and happy day
My game is working - with MasterAudio on the main scene; there are sound effects and playlists.
Only two scenes for the game; Main scene in hierarchy and bootstrapper is additively loaded with a persistent Playerstats class.
I want to copy MasterAudio to the bootstrapper scene; the reason is I want to load different playlists for different builds (Windows standalone and Windows-Steam)
The idea being that I would conditionally load one bootstrapper scene (with MasterAudio) for the Windows build but another bootstrapper for steam build (Master Audio with same effects but extra playlists - and SteamWorks Complete). Sorry if TMI.
I dragged MasterAudio to the (additively loaded) bootstrapper scene and checked Persist Across Scenes (no Master Audio on the Main Scene) but received errors.
I dragged MasterAudio to the (additively loaded) bootstrapper scene and checked Persist Across Scenes BUT left MasterAudio on the Main Scene with Persist Across Scenes Unchecked; this works but the MasterAudio on the bootstrapper seems to be destroyed at first run but then appears after a scene reload and multiple songs play.
Any advice about how to correctly use Master Audio in this way? I read the Best Practices article in the Master Audio documentation - to get started - but I don't need audio to persist across scenes so I may be misusing the information.
Thanks!
danosono
|
|
|
Post by danosono on Oct 11, 2022 23:06:59 GMT
Found this at dtdevtools.com/docs/masteraudio/AdvancedSettings.htm O_O Persist Across Scenes: Checking this will make it so the Master Audio game object (and all Playlist Controller game objects if you have them) will not be destroyed when loading new Scenes. If you are going to use this option, we recommend using a "bootstrapper" scene that only ever occurs once at the beginning of game play. The included example Scenes "BootstrapperDemoScene" and "GameScene" show this working with per-Scene sounds. Play the Bootstrapper Scene in the editor for instructions on setup. There is code in the Awake event of both Master Audio and Playlist Controller game objects to delete "extras" of those prefabs in case you choose not to use a bootstrapper scene and go back to the Scene with the persisted Master Audio. Note: Make sure your Playlist Controllers don't have a parent game object in the Scene or they will not persist since we cannot assume that the parent should persist. Note: If you use this option, you will likely want to use Dynamic Sound Group Creators to create temporary Sound Groups & Buses for each Scene. That way, only the Sound Groups that are used in all Scenes would be set up in the Master Audio game object and memory usage is not wasted, and you will have less Sound Groups overall for your sanity. And/or you should also investigate the different memory-saving Audio Origins. I'll start looking into the BootstrapperDemoScene
|
|
|
Post by DarkTonic Dev on Oct 12, 2022 1:58:33 GMT
Ok, let me know if you get stuck. Also if you "receive errors" please let me know exact text from the Console window as that will help a lot!
-B
|
|
|
Post by danosono on Oct 12, 2022 23:59:51 GMT
So I have been rethinking my priorities and will make a new topic if I can't figure it out; this can be closed if need be. Thanks for the help.
|
|
|
Post by DarkTonic Dev on Oct 13, 2022 0:08:53 GMT
Sounds good.
|
|