Skip to content

TextStudioDialogueSource

ClassTextStudioTextStudio
[AddComponentMenu("Text Studio/Integration/Dialogue Source")]
[HelpURL("https://www.wetzold.com/tools/text-studio")]
public sealed class TextStudioDialogueSource : MonoBehaviour, ITextStudioExternalTextSource

Generic bridge for narrative, dialogue, subtitle, and speech-bubble systems. Third-party tools can call this component without taking a package dependency on their APIs; Text Studio remains responsible for reveal, tags, effects, and renderer output.

RegisterMarkupPreprocessor(ITextStudioMarkupPreprocessor)

Section titled “RegisterMarkupPreprocessor(ITextStudioMarkupPreprocessor)”
public void RegisterMarkupPreprocessor(ITextStudioMarkupPreprocessor preprocessor)

Registers a dialogue-local markup transform in invocation order.

Parameters

Name Type
preprocessor TextStudio.ITextStudioMarkupPreprocessor

UnregisterMarkupPreprocessor(ITextStudioMarkupPreprocessor)

Section titled “UnregisterMarkupPreprocessor(ITextStudioMarkupPreprocessor)”
public bool UnregisterMarkupPreprocessor(ITextStudioMarkupPreprocessor preprocessor)

Stops applying a previously registered dialogue-local markup transform.

Parameters

Name Type
preprocessor TextStudio.ITextStudioMarkupPreprocessor

Returns

System.Boolean: true when the processor was registered.

public void ShowLine(string markup)

Replaces the current line, preprocesses it, and starts reveal playback.

Parameters

Name Type
markup System.String
public void SetLine(string markup, bool restartReveal)

Replaces and preprocesses the current line with explicit reveal-restart policy.

Parameters

Name Type
markup System.String
restartReveal System.Boolean
public void AppendToLine(string markup)

Preprocesses and appends markup while preserving the existing prefix’s reveal state.

Parameters

Name Type
markup System.String
public void ClearLine()

Clears source, processed line, and target output.

public bool AdvanceOrSkip()

Production dialogue “continue” behavior: first call completes the current reveal/wait, second call asks the owning dialogue system for the next line. Returns true only when the caller should advance externally.

Returns

System.Boolean

public TextStudioDialogueSource()

public TextStudioText Target { get; set; }

Returns

TextStudio.TextStudioText

public TextStudioText ConfiguredTarget { get; }

Returns

TextStudio.TextStudioText

public string SourceLine { get; }

Returns

System.String

public string CurrentLine { get; }

Returns

System.String

public bool RestartRevealOnLine { get; set; }

Returns

System.Boolean

public UnityEvent<string> OnLineShown { get; }

Returns

UnityEngine.Events.UnityEvent{System.String}

public UnityEvent OnLineComplete { get; }

Returns

UnityEngine.Events.UnityEvent

public UnityEvent OnAdvanceRequested { get; }

Returns

UnityEngine.Events.UnityEvent