Page 1 of 1
how Play AudioWaitOnce(entrytaglocal) from script
Posted: Sun Feb 19, 2023 8:45 am
by w4der
Hi,
How can I play Sequencer command from script. When dialogue is not started.
Use case:
Player is walking, he enter trigger and the AudioWaitOnce is invoked and the player says "Bla bla bla
"
Scene setup:
I have QuestControl, that controls the QuestSControl.SendToMessageSystem Explored:Stairs message.
I would like to add the audio that is localized.
Re: how Play AudioWaitOnce(entrytaglocal) from script
Posted: Sun Feb 19, 2023 8:50 am
by w4der
ok,
found solution
Code: Select all
public void PlayAudioWaitOnce(string audioClipName)
{
DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName})");
}
Re: how Play AudioWaitOnce(entrytaglocal) from script
Posted: Sun Feb 19, 2023 1:05 pm
by w4der
But the above code doesn't work with localization package. Without it it works properly.
Re: how Play AudioWaitOnce(entrytaglocal) from script
Posted: Sun Feb 19, 2023 3:05 pm
by Tony Li
Hi,
What do you mean? Does the problem have compile errors? Does it log errors when you play? Does it work with the default language but not with localization?
Re: how Play AudioWaitOnce(entrytaglocal) from script
Posted: Tue Feb 21, 2023 2:04 pm
by w4der
Hi,
I added the unity localization package and it works very good with the Dialogue Sequences with entrytaglocal.
It doesn't work with the code below, because it doesn't add the locale identifier as it is done with the entrytaglocal.
Code: Select all
DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName})");
But I found solution and I add the locale identifier by my own. The code below works properly.
Code: Select all
var locale = LocalizationSettings.SelectedLocale;
DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName}_{locale.Identifier.Code})");
I hope this post one day help somebody.
Re: how Play AudioWaitOnce(entrytaglocal) from script
Posted: Tue Feb 21, 2023 2:14 pm
by Tony Li
Thanks for sharing.