Skip to main content

Class DialoguePresenter

A component that controls the presentation of dialogue entries in the UI. Handles displaying dialogue text, switching between speech and thought bubbles, playing associated audio clips, and applying the typewriter text effect.

public class DialoguePresenter : MonoBehaviour

Inheritance​

Properties​

text​

The current text displayed by the dialogue panel. Setting this value updates the TMP text component.

public string text { get; }

Property Value​

string

Methods​

DisableDialogueTween()​

Animates the dialogue panel disappearing by scaling it down, then deactivates the game object when the animation completes.

public void DisableDialogueTween()

SetAudio(AudioClip)​

Plays the specified audio clip through the presenter's AudioSource.

public void SetAudio(AudioClip audio)

Parameters​

NameTypeDescription
audioAudioClipThe audio clip to play.

SetDialogueView(DialogueEntry)​

Updates the dialogue UI with a new dialogue entry. Displays the correct bubble, text, and audio, and triggers the typewriter effect.

public void SetDialogueView(DialogueEntry entry)

Parameters​

NameTypeDescription
entryDialogueEntryThe dialogue entry to display.

SetText(string)​

Sets the dialogue text displayed by the presenter.

public void SetText(string sourceText)

Parameters​

NameTypeDescription
sourceTextstringThe text to display.
  • Properties
    • text
  • Methods
    • DisableDialogueTween()
    • SetAudio(AudioClip)
    • SetDialogueView(DialogueEntry)
    • SetText(string)