OnConversationStart/End events
Posted: Thu Feb 04, 2021 8:42 pm
Hey,
I'd like to subscribe to conversation-starting and conversation-ending events through script so my game manager can know when to enter and when to exit its dialogue state — which is whenever any conversation starts or ends. I'm assuming they're static actions? I'd like to do something that basically amounts to this:
From what I gather from documentation, something to that effect does exist but I can't seem to find these particular events — it doesn't appear I can access them from the DialogueManager or anywhere else. I'm probably missing something very obvious here, but search results unfortunately didn't help. Could you please help me out with that? That would be very much appreciated.
Cheers.
I'd like to subscribe to conversation-starting and conversation-ending events through script so my game manager can know when to enter and when to exit its dialogue state — which is whenever any conversation starts or ends. I'm assuming they're static actions? I'd like to do something that basically amounts to this:
Code: Select all
using PixelCrushers.DialogueSystem;
private State state;
private void Awake()
{
Wherever.OnConversationStart += EnterDialogueState;
Wherever.OnConversationEnd += ExitDialogueState;
}
private void EnterDialogueState() => this.state = State.Dialogue;
private void ExitDialogueState() => this.state = State.Main;
Cheers.