Dialogue Box

📦 DialogueBox Class

Feel Speak's main dialogue box base class.

Namespace: Esper.FeelSpeak.UI.UGUI Inherits from: MonoBehaviour Type: abstract class


📦 Fields

Access
Field
Type
Description

public

mode

DialogueMode

The dialogue mode. Controls text display behavior.

public

dontDestroyOnLoad

bool

If this object should not be destroyed when the scene is unloaded.

public

speakerCycle

SpeakerCycle

The speaker cycling type.

public

primaryDialogueSpeaker

DialogueSpeaker

The primary dialogue speaker.

public

secondaryDialogueSpeaker

DialogueSpeaker

The secondary dialogue speaker.

public

activeDialogueSpeaker

DialogueSpeaker

The current active dialogue speaker.

public

onOpen

UnityEvent

A callback for when the dialogue box is opened.

public

onClose

UnityEvent

A callback for when the dialogue box is closed.

protected

targetSpeaker

Speaker

The speaker being talked to.

protected

lastReplaced

DialogueSpeaker

The last speaker that was replaced.

protected

lastGraph

DialogueGraph

The last active dialogue graph.

protected

typingCoroutine

Coroutine

The active typing coroutine.

protected

textSoundDelayCoroutine

Coroutine

The active text sound delay coroutine.

protected

delayCoroutine

Coroutine

The active delay coroutine.

protected

fullText

string

The current full text that is displayed or is being typed out.

protected

dialogueInfo

DialogueInfo

The active dialogue info.


📋 Properties

Access
Property
Type
Description

public

IsDelayOn

bool

If dialogue continuation is currently delayed due to a delay node.

public

IsTextPauseEnabled

bool

If the dialogue text is currently paused due to a sentence ender or a tag. Pauses are usually very short. This value will be updated immediately as the text pause state changes.

protected

IsTextSoundDelayOn

bool

If the text sound delay is currently enabled.

public

IsPrimaryActive

bool

If the primary speaker is currently active.

public

IsSecondaryActive

bool

If the secondary speaker is currently active.

public

IsTypingOut

bool

If the text is currently being typed out.

public abstract

IsOpen

bool

If the dialogue box is currently open.

public

IsDialogueRunning

bool

If the dialogue box is actively displaying dialogue.

public static

Instance

DialogueBox

The active instance.


🧰 Methods

Access
Method
Returns
Description

protected virtual

Awake()

void

Unity lifecycle method for initialization.

protected virtual

Start()

void

Unity lifecycle method called before first frame update.

public virtual

IsSpeaking(Speaker)

bool

Checks if a speaker is currently speaking.

public virtual

TriggerEmotionBubble(string, Sprite, float?)

void

Triggers an emotion bubble for a visible speaker.

public

GetPresentSpeaker(string)

DialogueSpeaker

Gets a present speaker by name.

public virtual

StartDialogue(Speaker)

void

Opens the dialogue box and starts dialogue with a speaker.

public virtual

StartDialogue(DialogueGraph)

void

Opens the dialogue box and starts dialogue with a dialogue graph.

public virtual

StartDialogue()

void

Opens the dialogue box and starts dialogue using prepared dialogue.

protected virtual

StartPreparedDialogue()

void

Opens the dialogue box and starts prepared dialogue.

public virtual

EndDialogue()

bool

Ends the dialogue and closes the dialogue box.

public virtual

SelectDialogue(DialogueOption)

void

Move on to the next dialogue by invoking a dialogue option.

public virtual

Next(int?, bool)

void

Move on to the next dialogue or node with optional choice index.

public virtual

Next()

void

Move on to the next dialogue or node.

protected virtual

Apply(DialogueNode)

void

Applies the properties of a dialogue node.

protected virtual

Apply(ChoiceNode)

void

Applies the properties of a choice node.

protected virtual

Apply(DelayNode)

void

Applies the properties of a delay node.

protected virtual

Apply(NestNode)

void

Applies the properties of a nest node.

public virtual

FastForward()

bool

Fast forwards the dialogue if possible.

protected virtual

AutomaticNextOnComplete()

void

Triggers Next if the current dialogue node's automaticNextOnComplete value is true.

public virtual

StopActiveVoiceLine()

void

Stops the voice line currently playing.

public abstract

Hide()

void

Hides the dialogue box.

public abstract

Show()

void

Shows the dialogue box.

public virtual

Open()

void

Opens the dialogue box.

public virtual

Close()

void

Closes the dialogue box.

protected abstract

StartTyping()

void

Starts typing out the text.

public virtual

SetPrimaryActive(Color?, Color?)

void

Sets the primary speaker as active.

public virtual

SetSecondaryActive(Color?, Color?)

void

Sets the secondary speaker as active.

public virtual

UpdateSpeakerElements()

void

Updates the speaker UI elements.

public

PrepareDialogue(DialogueGraph)

bool

Prepares dialogue synchronously.

public

PrepareDialogueAsync(DialogueGraph)

Task<bool>

Prepares dialogue asynchronously.

public

IsDialogueNested()

bool

If the active dialogue is nested.

protected

TextSoundDelay()

IEnumerator

Delays text sounds.

protected

Delay(float)

IEnumerator

Executes a delay.

protected virtual

OnLocaleChanged(UnityEngine.Localization.Locale)

void

Handles locale change events.

protected abstract

TypeText()

IEnumerator

A coroutine that types out the dialogue text character by character.


🧩 Nested Enums

public enum DialogueMode Supported dialogue modes.

Value
Description

Instant

Instantly show text. Text sounds will not be used.

Typewriter

Type out each character one by one. Text sounds are used.

public enum SpeakerCycle Supported speaker cycling modes.

Value
Description

Single

Only one speaker is visible at a time.

Double

The latest two speakers are visible at a time. A new speaker replaces an existing one, prioritizing the inactive speaker.

Last updated