Hello,
I'm having difficulty figuring out how to retrieve the previous dialogue entry via C#. I am needing the information for a sequencer event if that helps at all.
Thanks,
-D
Get Previous Dialogue Entry Via code?
Re: Get Previous Dialogue Entry Via code?
Hi,
You'll have to track that yourself. You can use an OnConversationLine method. For example, add a script like this to the Dialogue Manager:
You'll have to track that yourself. You can use an OnConversationLine method. For example, add a script like this to the Dialogue Manager:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class RecordPreviousEntry : MonoBehaviour
{
public DialogueEntry previousDialogueEntry;
public DialogueEntry currentDialogueEntry;
void OnConversationStart(Transform actor)
{
previousDialogueEntry = null;
}
void OnConversationLine(Subtitle subtitle)
{
previousDialogueEntry = currentDialogueEntry;
currentDialogueEntry = subtitle.dialogueEntry;
}
}