Hello !
Is there a way to detect when responses are shown on screen ? I need to display something when the response panel is appearing.
OnConversationLine is not fired for responses and I have not seen something like a OnResponse. Do I have to use OnContinue ?
Thanks !
Event when responses are shown
Event when responses are shown
Hi,
No message like OnConversationLine is sent when the responses are shown. Here are two ways to detect when responses are shown:
1. When the dialogue UI shows responses, it activates the Response Panel GameObject. You can add a script that implements OnEnable:
void OnEnable() {
if (PixelCrushers.DialogueSystem.DialogueManager.IsConversationActive) {
// (response menu shown; show your "something")
}
}
By the way, if your "something" is a child of Response Panel, it will be automatically shown when Response Panel is activated.
2. Alternate method: Create a subclass of your dialogue UI class (e.g., a subclass of UnityDialogueUI). Override the ShowResponses method:
using PixelCrushers.DialogueSystem;
public class MyDialogueUI : UnityDialogueUI {
public override void ShowResponses(Subtitle subtitle, Response[] responses, float timeout) {
base.ShowResponses(subtitle, responses, timeout);
// (show your "something" here)
}
}
Then just inspect your dialogue UI and drag this into the Script slot.
No message like OnConversationLine is sent when the responses are shown. Here are two ways to detect when responses are shown:
1. When the dialogue UI shows responses, it activates the Response Panel GameObject. You can add a script that implements OnEnable:
void OnEnable() {
if (PixelCrushers.DialogueSystem.DialogueManager.IsConversationActive) {
// (response menu shown; show your "something")
}
}
By the way, if your "something" is a child of Response Panel, it will be automatically shown when Response Panel is activated.
2. Alternate method: Create a subclass of your dialogue UI class (e.g., a subclass of UnityDialogueUI). Override the ShowResponses method:
using PixelCrushers.DialogueSystem;
public class MyDialogueUI : UnityDialogueUI {
public override void ShowResponses(Subtitle subtitle, Response[] responses, float timeout) {
base.ShowResponses(subtitle, responses, timeout);
// (show your "something" here)
}
}
Then just inspect your dialogue UI and drag this into the Script slot.