Hi Tony,
1. I have a built-in time manager that is completely separate from the Dialogue System, and I'd like to call a method (this method exists and works fine) to pause at the start of ANY conversation and unpause after the conversation is over. Is there a place I can do this globally so I don't have to add the method calls to every conversation?
I looked through the forums and found some ideas, but they all seemed a bit more involved than what I'm looking to do, but apologies if I missed something.
2. Unrelated to the above question, when starting dialogue with DialogueManager.StartConversation("dialogue name", actor, conversant), what's the best way to pause the game during the conversation like you would with a Dialogue System Trigger?
Thanks!
Calling a method on every conversation
Re: Calling a method on every conversation
Hi,
For both cases, add a script to the Dialogue Manager that has OnConversationStart and OnConversationEnd script messages. Example:
Alternatives:
For both cases, add a script to the Dialogue Manager that has OnConversationStart and OnConversationEnd script messages. Example:
Code: Select all
using UnityEngine;
public class PauseTimeManagerDuringConversations : MonoBehaviour
{
void OnConversationStart(Transform actor)
{
// Your code here to pause your time manager.
}
void OnConversationEnd(Transform actor)
{
// Your code here to unpause your time manager.
}
}
- Add a Dialogue System Events component to the Dialogue Manager, and hook up the OnConversationStart() and OnConversationEnd() UnityEvents to your time manager (assuming it's accessible as a DontDestroyOnLoad component or ScriptableObject asset).
- Or hook into the DialogueManager.instance.conversationStarted and conversationEnded C# events.