Hi,
Here are some ways you can do this. You can choose the one that works best for your situation.
1. Use the sequencer
->Message() and @Message syntax. This example uses
SALSA for lipsync:
Code: Select all
AnimatorTrigger(speaking);
SALSA(entrytag)->Message(Done);
AnimatorTrigger(idle)@Message(Done)
The sequence above sets the Animator's "speaking" trigger and plays a lipsynced audio clip through SALSA. The audio clip is defined by the dialogue entry's unique
entrytag for automation, so you could use this as the Dialogue Manager's Default Sequence. When the SALSA() command is done, it sends the message "Done" to the sequencer. The last command waits until it receives the message "Done", and then it sets the Animator's "idle" trigger.
2. Use a
Response Menu Sequence field. From the manual: This is "an optional field that specifies a sequence that will play in the background after the dialogue entry's text has been delivered and the response menu is being shown." You can add Response Menu Sequence to the dialogue database
template to make it apply to all dialogue entries.
3. Write a script with an OnConversationLine method. Add it to the Dialogue Manager. For example:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class IdleBeforeLine : MonoBehaviour {
public void OnConversationLine(Subtitle subtitle) {
// Idle before speaking the next line:
subtitle.speakerInfo.transform.GetComponent<Animator>().SetTrigger("idle");
}
}
4. Write a subclass of your dialogue UI. Override HideSubtitle:
Code: Select all
public class MyDialogueUI : UnityUIDialogueUI {
public override void HideSubtitle(Subtitle subtitle) {
// Idle when done speaking the line:
subtitle.speakerInfo.transform.GetComponent<Animator>().SetTrigger("idle");
}
}