How To: Skip To Player's Line
Posted: Wed Dec 18, 2019 9:46 am
To skip all NPC lines until the conversation reaches a player line, use a script like this:
NPCLineSkipper.cs
NPCLineSkipper.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class NPCLineSkipper : MonoBehaviour
{
public bool skipToPlayerLine = false; //<-- SET TRUE TO SKIP NPC LINES.
void OnConversationLine(Subtitle subtitle)
{
// If speaker is NPC and the next line is also an NPC line, skip ahead by setting the Sequence to Continue():
if (skipToPlayerLine && subtitle.speakerInfo.isNPC && DialogueManager.currentConversationState.pcResponses.Length == 0)
{
subtitle.sequence = "Continue()";
}
}
}