Hello I was following this post below on how to implement a skip button. How can I make it so it stop on the final dialogue element instead of auto-closing the conversation?
I want to implement this just in case the player presses skip by accident. Thank you Pixel Crushers!
That post is close to 8 years old. You can use the Conversation Control component now. Add it to your Dialogue Manager or dialogue UI and configure a UI Button to call ConversationControl.SkipAll. If you want it to stop on the last line instead of skipping past it and ending the conversation, make a subclass that overrides OnConversationLine():
public class MyConversationControl : ConversationControl
{
public override void OnConversationLine(Subtitle subtitle)
{
if (!DialogueManager.currentConversationState.hasAnyResponses) return;
base.OnConversationLine(subtitle);
}
}
That post is close to 8 years old. You can use the Conversation Control component now. Add it to your Dialogue Manager or dialogue UI and configure a UI Button to call ConversationControl.SkipAll. If you want it to stop on the last line instead of skipping past it and ending the conversation, make a subclass that overrides OnConversationLine():
public class MyConversationControl : ConversationControl
{
public override void OnConversationLine(Subtitle subtitle)
{
if (!DialogueManager.currentConversationState.hasAnyResponses) return;
base.OnConversationLine(subtitle);
}
}
I would like to add one more question to that subject. In ConversationControl.SkipAll code invoke sequences from all the Nodes, what I can do to run only sequneces in END Node?
After importing the script I have error:
Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\UI\Utility\ConversationControl.cs(39,35): error CS0117: 'GameObjectUtility' does not contain a definition for 'FindFirstObjectByType'
We have Unity ver 2020.3.38f1 and FindFirstObjectByType is not implemented in this version
Code compile without errors and in game "skip dialogue" workig properly without any issue in console.
Right now we can't allow ourself to update DS (because time, and chance of something going side ways after update).
That's absolutely fine. Unity 2023 will flag FindObjectOfType<T>() as being obsolete. That's why we introduced GameObjectUtility.FindFirstObjectByType<T>(). For earlier versions of Unity, FindObjectOfType<T>() works the same.