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.