Stop and Start conversation in a same frame
Posted: Mon Nov 23, 2020 9:23 am
Hello,
I am stopping a conversation with Override Dialogue UI and starting a conversation with non-override dialogue UI (default dialogue UI).
The latter conversation should use the default dialogue UI has no Override Dialogue UI component in any of actor/speaker/conversant in the conversation. Conversation info/setting in the inspector does not have any Override setting as well.
Below is sequence command that I am using to call/switch the conversation.
and calling it in sequence
I am stopping a conversation with Override Dialogue UI and starting a conversation with non-override dialogue UI (default dialogue UI).
The latter conversation should use the default dialogue UI has no Override Dialogue UI component in any of actor/speaker/conversant in the conversation. Conversation info/setting in the inspector does not have any Override setting as well.
Below is sequence command that I am using to call/switch the conversation.
Code: Select all
public class SequencerCommandAmberAlert : SequencerCommand
{
public void Awake()
{
PixelCrushers.UIPanel.monitorSelection = false;
StartCoroutine(coroutine_StartAmberAlert());
}
IEnumerator coroutine_StartAmberAlert()
{
GameObject obj = GameObject.Find("SMS_Dialogue_Panel");
Debug.Log("object found:" + obj);
if (obj)
{
Animator SMS_ScreenEventAnimator = obj.GetComponent<Animator>();
Debug.Log("object found:" + SMS_ScreenEventAnimator);
if (SMS_ScreenEventAnimator)
{
SMS_ScreenEventAnimator.SetTrigger("AmberAlert");
}
}
yield return new WaitForSeconds(5); // wait until the animation end.
DialogueManager.StopConversation();
GameManager.Instance.eventSystemModule.enabled = true;
PixelCrushers.UIPanel.monitorSelection = true;
DialogueManager.StartConversation("Ch01_Intro01_Apt_Scn_05_B");
Stop();
}
}
and calling it in sequence
Code: Select all
SetInput(false);
AmberAlert()@1;