|
Post by Illusion Walk on Jun 1, 2021 8:26:28 GMT
Hi, the changes of the last update of version 2020.3.8 doesn't work for me using variations. The changes in the method MasterAudio.CanFindVariationToPlay(...) seems to be responsible. The variations could not be found in some cases because the property aSource.Variation.GameObjectName holds an "old" name containing a "(Clone)" suffix. It works fine if I revert the changes to the old if statement like:
if (aSource.Source.name == variationName) { // name match }
But I think the Variation.GameObjectName property should be fixed because the variation GameObject name contains the "(Clone)" suffix only for a short time on instantiating.
Regards
|
|
|
Post by DarkTonic Dev on Jun 1, 2021 20:22:52 GMT
Thanks, I will see if it's fixable with the GameObjectName property and report back.
|
|
|
Post by DarkTonic Dev on Jun 2, 2021 20:33:15 GMT
I've moved the initialization of GameObj from Awake to Start in SoundGroupVariation.cs, see if this works for you and let me know please.
private void Awake() { original_pitch = VarAudio.pitch; original_volume = VarAudio.volume; _audioLoops = VarAudio.loop; var c = VarAudio.clip; // pre-warm the clip access
if (c != null || _isWarmingPlay) { } // to disable the warning for not using it.
if (VarAudio.playOnAwake) { Debug.LogWarning("The 'Play on Awake' checkbox in the Variation named: '" + name + "' is checked. This is not used in Master Audio and can lead to buggy behavior. Make sure to uncheck it before hitting Play next time. To play ambient sounds, use an EventSounds component and activate the Start event to play a Sound Group of your choice."); } }
// ReSharper disable once UnusedMember.Local private void Start() { var g = GameObj; // pre-warm the game object clip access if (g != null) { }
// this code needs to wait for cloning (for weight).
|
|
|
Post by Illusion Walk on Jun 3, 2021 7:31:36 GMT
Thanks for your quick reply.
Unfortunately, your fix is not working for me.
There is still the "(Clone)" suffix in the Variation.GameObjectName property which prevents to find the correct variation name.
|
|
|
Post by DarkTonic Dev on Jun 3, 2021 18:16:19 GMT
I'm not seeing that. Please email me at support@darktonic.com with your Asset Store Invoice PDF file and I'll send you the beta.
Thanks. -Brian
|
|
|
Post by Illusion Walk on May 10, 2022 10:54:19 GMT
Hi, just a quick feedback for the current version Master Audio 2022 v1.0.1:
I still have the problem that the variant is not found because of the suffix "(Clone)" in its name.
But my hotfix by adding
if (aSource.Source.name == variationName) { // name match } to MasterAudio.cs in line 2604 works fine.
Regards
|
|
|
Post by DarkTonic Dev on May 10, 2022 16:51:42 GMT
Line numbers aren't matching up. Here's a block of code I have starting at line 2592.
for (var i = 0; i < sources.Count; i++) { var aSource = sources[i]; if (!string.IsNullOrEmpty(aSource.Variation.clipAlias) && aSource.Variation.clipAlias == variationName) { // name match } else if (aSource.Variation.GameObjectName == variationName) { // name match } else { continue; }
matchesFound++; if (aSource.Variation.IsAvailableToPlay || (canUseBusVoiceToStop && aSource.Variation == busVoiceToStop)) { choiceMatches.Add(i); } }
What did you change it to so I can assess?
-Brian
|
|
|
Post by Illusion Walk on May 11, 2022 6:42:22 GMT
This is my code change within your code block at line 2592:
for (var i = 0; i < sources.Count; i++) { var aSource = sources[i]; if (!string.IsNullOrEmpty(aSource.Variation.clipAlias) && aSource.Variation.clipAlias == variationName) { // name match } else if (aSource.Variation.GameObjectName == variationName) { // name match } else if (aSource.Source.name == variationName) { // <<< ADDED FIX HERE // name match } else { continue; }
matchesFound++; if (aSource.Variation.IsAvailableToPlay || (canUseBusVoiceToStop && aSource.Variation == busVoiceToStop)) { choiceMatches.Add(i); } } Sorry for the confusion. The wrong line number was my mistake.
|
|
|
Post by DarkTonic Dev on May 11, 2022 17:22:00 GMT
Thanks, I've fixed that for the next update. I've also made the if branch update the GameObjectName to the correct one so the next check won't need that allocation (.name).
-B
|
|
|
Post by Illusion Walk on May 12, 2022 6:27:23 GMT
Thank you very much!
|
|
|
Post by DarkTonic Dev on May 12, 2022 14:31:28 GMT
Thank you as well.
|
|