mush
New Member
Posts: 39
Posts: 39
|
Post by mush on Aug 3, 2016 1:35:01 GMT
Hello,
I have made several Dynamic Sound groups - 1 is for all the major SFX and then rest are for different languages.
On the main sound group I have activated the Auto Create Items and disabled the Auto Removed Items and all works well.
For the other sound groups i have deactivated the Auto Create Items as I only want them to be created if the user changes languages.
I can not get the CreateItems() function to work - so how do I manually load the sound group.
Also I will be wanting to RemoveItems() if the language is changed to free up memory of the unneeded language files.
Best regards, Chris.
|
|
|
Post by DarkTonic Dev on Aug 3, 2016 5:03:23 GMT
Did you look into the localization feature? That might be easier....
If you have and don't want to use it, let me know and I'll respond to the original question.
|
|
mush
New Member
Posts: 39
Posts: 39
|
Post by mush on Aug 3, 2016 6:05:53 GMT
Wow that would have been a lot easier - great job btw. Master Audio is so versatile that I ended up making a Dynamic Sound Group for each language which is disabled by default but has the awesome Auto Create Items enabled and persistent settings set. Upon entering main menu I enable the current language sound group. If the user selects another language I enable that language group there and then (There is a 1 sec very slight gulp on device whilst loading the new sound group but there are 64 300kb or so wav files that load way quicker than I could do - so no complaints from me . When I come back from gameplay to main menu Master Audio does its magic and skips over the already loaded language files I suppose I should unload the sound group files that are not needed after choosing another language but at this stage I am more than happy with the versatility
|
|
|
Post by DarkTonic Dev on Aug 3, 2016 7:10:49 GMT
So are you using localized resource files now, or no?
If you are, they should be unloaded automatically when you change language (actually they're always unloaded unless they're playing).
|
|
mush
New Member
Posts: 39
Posts: 39
|
Post by mush on Aug 3, 2016 22:08:07 GMT
Oh I see, "unloaded when not in use" might not work for me as I want them in memory ready to go with absolutely zero lag when I call them. No I did not end up using localised feature for now. I have one central SFX Dynamic Sound Group and Master Audio allows me to add the desired language sounds to that when I enable the said language dynamic sound group. I am still interested in how CreateItems and RemoveItems can be called manually especially in a scenario where I will not have auto create ticked
|
|
|
Post by DarkTonic Dev on Aug 4, 2016 3:16:48 GMT
Oh I see, "unloaded when not in use" might not work for me as I want them in memory ready to go with absolutely zero lag when I call them. No I did not end up using localised feature for now. I have one central SFX Dynamic Sound Group and Master Audio allows me to add the desired language sounds to that when I enable the said language dynamic sound group. I am still interested in how CreateItems and RemoveItems can be called manually especially in a scenario where I will not have auto create ticked What I do is spawn the specific prefab that has a DGSC I need the sounds from, from code. And it creates its items automatically. Then I can despawn it from code when I don't need the sounds anymore. That way you don't need to call the methods in the DGSC, just leave them on the default (auto-create / auto-remove) since they fire on OnEnable and OnDisable. For spawning / despawning you can use PoolBoss (in Core GameKit) or plain old' Instantiate and Destroy calls, but the latter can cause a frame rate skip sometimes. But if you want to call the methods on DGSC, you just need to add a field of type: DynamicSoundGroupCreator, and assign it. Then you can call those 2 methods.
|
|
mush
New Member
Posts: 39
Posts: 39
|
Post by mush on Aug 4, 2016 23:23:50 GMT
Good idea about just spawning the DGSC - so when I despawn the sound files will unload because auto-remove is on - nice.
Any ideas why the latest Core game Kit shows up as red in monodevelop - as though it is not global?
|
|
|
Post by DarkTonic Dev on Aug 4, 2016 23:29:20 GMT
Cool.
|
|