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
| Name | Type | Description |
|---|---|---|
audio | AudioClip | The 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
| Name | Type | Description |
|---|---|---|
entry | DialogueEntry | The dialogue entry to display. |