|
Post by Saif on Mar 12, 2024 14:19:57 GMT
Hello,
First of all thank you for this great plugin. I need to reset the following when I reset the game, maybe this could be a function run by stopmixer: - Reset all buses and sound groups to their initial volumes and pitches. - Sound groups that have their variation sequence set to "Top to bottom" they need to be reset so they'd start again from the top.
I started a previous thread where I asked to stop events like FadeBusToVolume when I reset the game and you kindly provided a code for that, I just haven't been able to figure the above.
Kind regards,
Saif
|
|
|
Post by DarkTonic Dev on Mar 15, 2024 17:59:28 GMT
Hey, sorry for the delay, I've been (and still am) ill.
Bus / Group pitch is not tracked at all, it simply sets the pitch of all the individual Variations of all Sound Groups on that Bus.
See if this does the trick for you and let me know. Put it in MasterAudio.cs and call it when needed.
public static void RestoreOriginalMixerVolumesAndPitches() { for (var i = 0; i < Instance.groupBuses.Count; i++) { var aBus = Instance.groupBuses[i]; var bus = GrabBusByName(aBus.busName); SetBusVolume(bus, bus.OriginalVolume); }
foreach (var key in Instance.AllSoundGroupNames) { var theGroup = Instance.AudioSourcesBySoundType[key]; foreach (var variation in theGroup.Sources) { variation.Variation.VarAudio.volume = variation.Variation.original_volume; variation.Variation.VarAudio.pitch = variation.Variation.original_pitch; } RefillSoundGroupPool(theGroup.Group.name); } }
|
|
|
Post by Saif on Mar 16, 2024 2:59:41 GMT
I'm sorry to hear that you're ill, don't worry about the delayed reply. I did a similar approach, but I pre-referenced all the busses and groups from my dynamic creators with their original parameters. Your code is cleaner, thank you for that!
|
|
|
Post by DarkTonic Dev on Mar 16, 2024 15:41:28 GMT
Cool, I'll put it in the next update. Thanks!
|
|