EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Display.DialoguePanel Class Referenceabstract

The DialoguePanel is an abstract component which provides a set of core features for components/panels which make up a dialogue display. Specifically, this class provides functionality for showing and hiding a dialogue panel and handling the animation associated with those actions. More...

Inherits EasyTalk.Controller.DialogueListener, and EasyTalk.Display.LocalizableComponent.

Inherited by EasyTalk.Display.ContinueDisplay, EasyTalk.Display.ConversationDisplay, and EasyTalk.Display.OptionDisplay.

Public Member Functions

virtual void Init ()
 Initializes the panel by storing the original position.
 
void Activate ()
 Sets the panel to be active, and recursively sets all parent game objects to be active.
 
void Deactivate ()
 Makes the panel inactive.
 
bool ForceStandardText ()
 
IEnumerator WaitForAnimation ()
 Asynchronously waits for the currently running animation on this panel to complete.
 
virtual void Hide (bool deactivateAfterHide=true)
 Hides the panel.
 
void HideImmediately (bool deactivateAfterHide=true)
 Hides the panel immediately (doesn't use a transition animation).
 
void ShowImmediately ()
 Shows the panel immediately (doesn't use a transition animation).
 
virtual void Show ()
 Shows the panel.
 
- Public Member Functions inherited from EasyTalk.Controller.DialogueListener
virtual void OnContinue ()
 Called whenever the dialogue continues on to the next line.
 
virtual void OnDisplayOptions (List< DialogueOption > options)
 Called whenever dialogue options are to be presented.
 
virtual void OnOptionChosen (DialogueOption option)
 Called whenever an option is chosen from the currently presented list of options.
 
virtual void OnDisplayLine (ConversationLine conversationLine)
 Called when a line of dialogue is to be presented.
 
virtual void OnDialogueEntered (string entryPointName)
 Called whenever a dialogue is entered (when playback begins).
 
virtual void OnDialogueExited (string exitPointName)
 Called whenever a dialogue is exited (when playback ends).
 
virtual void OnExitCompleted ()
 Called at least one frame after a dialogue is exited.
 
virtual void OnStory (string storyText)
 Called whenever a story node is encountered.
 
virtual void OnVariableUpdated (string variableName, object value)
 Called whenever a dialogue variable value is updated.
 
virtual void OnCharacterChanged (string oldCharacterName, string newCharacterName)
 Called whenever a character change is detected.
 
virtual void OnAudioStarted (ConversationLine line)
 Called whenever audio starts playing for a line of dialogue.
 
virtual void OnAudioCompleted (ConversationLine line, bool forceStopped)
 Called whenever audio stops playing for a line of dialogue.
 
virtual void OnActivateKey (string key)
 Called whenever a key tag is present in a line of dialogue.
 
virtual void Wait (float timeInSeconds)
 Called whenever the dialogue encounters a wait node.
 
virtual void OnConversationEnding (ConversationLine line, Node nextNode)
 Called whenever the last line of dialogue in a conversation node is reached.
 
virtual void OnNodeChanged (Node node)
 Called whenever dialogue playback moves to the next node.
 
virtual void OnPause (string signal)
 Called whenever a pause node is reached during dialogue playback.
 

Public Attributes

UnityEvent onHideStart = new UnityEvent()
 An event which is triggered whenever the panel starts being hidden.
 
UnityEvent onHideComplete = new UnityEvent()
 An event which is triggered whenever the panel has finished transitioning to a hidden state.
 
UnityEvent onShowStart = new UnityEvent()
 An event which is triggered whenever the panel starts being shown.
 
UnityEvent onShowComplete = new UnityEvent()
 An event which is triggered whenever the panel has finished transitioning to a shown state.
 
- Public Attributes inherited from EasyTalk.Controller.DialogueListener
bool debugEnabled = false
 When set to true, debug logging will be shown for each method called on the listener.
 
UnityEvent onContinue = new UnityEvent()
 An event which is triggered whenever the dialogue continues.
 
UnityEvent onDisplayOptions = new UnityEvent()
 An event which is triggered whenever options are to be displayed to the player.
 
UnityEvent onOptionChosen = new UnityEvent()
 An event which is triggered whenever the player chooses an option.
 
UnityEvent onDisplayLine = new UnityEvent()
 An event which is triggered whenever a line of dialogue is to be displayed.
 
UnityEvent onDialogueEntered = new UnityEvent()
 An event which is triggered whenever dialogue playback begins.
 
UnityEvent onDialogueExited = new UnityEvent()
 An event which is triggered whenever dialogue playback ends.
 
UnityEvent onExitCompleted = new UnityEvent()
 An event which is triggered one frame after dialogue playback ends.
 
UnityEvent onStory = new UnityEvent()
 An event which is triggered whenever a story node is encountered.
 
UnityEvent onVariableUpdated = new UnityEvent()
 An event which is triggered whenever a dialogue variable value is updated.
 
UnityEvent onCharacterChanged = new UnityEvent()
 An event which is triggered whenever a character name change is detected.
 
UnityEvent onAudioStarted = new UnityEvent()
 An event which is triggered whenever dialogue audio starts playing.
 
UnityEvent onAudioCompleted = new UnityEvent()
 An event which is triggered whenever dialogue audio finishes playing.
 
UnityEvent onActivateKey = new UnityEvent()
 An event which is triggered whenever a key is to be processed on a dialogue.
 
UnityEvent onWait = new UnityEvent()
 An event which is triggered whenever a dialogue starts waiting for a certain period of time before continuing.
 
UnityEvent onConversationEnding = new UnityEvent()
 An event which is triggered whenever the last line of dialogue in a conversation node is reached.
 
UnityEvent onNodeChanged = new UnityEvent()
 An event which is triggered whenever a the dialogue flows from one node to another.
 
UnityEvent onPause = new UnityEvent()
 An event which is triggered whenever the dialogue reaches a pause node, pausing and waiting for Continue() to be called.
 

Protected Member Functions

IEnumerator SlideDisplayOut (bool deactivateAfterSlide=true)
 Asynchronously slides the display out of its Canvas' bounds.
 
IEnumerator SlideDisplayIn ()
 Asynchronously slides the display into its Canvas' bounds. If returnToOriginalPosition is set to true, then the panel will slide to its original position.
 
IEnumerator FadeDisplayIn ()
 Asynchronously fades the display and all of its child text and image components in to their original transparency values.
 
IEnumerator FadeDisplayOut (bool deactivateAfterFade=true)
 Asynchronously fades the display and all of its child text and image components out to be completely transparent.
 

Protected Attributes

bool forceStandardText = false
 Whether the Display uses standard Text components rather than TextMeshPro components, even with TextMeshPro installed.
 
Vector3 originalPosition = Vector3.zero
 The original position of the panel.
 
bool isHidden = false
 Whether the panel is currently hidden.
 

Properties

string DisplayID [get, set]
 Gets or sets the Display ID of the panel.
 
bool IsHidden [get]
 Gets whether the panel is currently hidden.
 
Vector3 OriginalPosition [get]
 Gets the original position of the panel.
 
UIAnimator.Animation AnimationType [get, set]
 Gets or sets the animation type used for showing and hiding the panel.
 
bool OverrideFontSizes [get, set]
 Gets or sets whether the component should override the default font sizes.
 
LanguageFontOverrides LanguageFontOverrides [get, set]
 Gets or sets the LanguageFontOverrides to use on the component.
 
int MinFontSize [get, set]
 Gets or sets the minimum font size to use on the component.
 
int MaxFontSize [get, set]
 Gets or sets the maximum font size to use on the component.
 
- Properties inherited from EasyTalk.Display.LocalizableComponent

Private Member Functions

void OnValidate ()
 Enables and disables TextMeshPro components and Unity standard Text components based on whether TextMeshPro is installed.
 
void CancelShowRoutine ()
 Stops the coroutine for showing the panel, if it's running.
 
void CancelHideRoutine ()
 Stops the coroutine for hiding the panel, if it's running.
 

Private Attributes

string displayID = null
 The display ID of the panel.
 
UIAnimator.Animation animationType = UIAnimator.Animation.NONE
 The animation type to use when hiding/showing the panel.
 
AnimationCurve animationCurve = AnimationCurve.EaseInOut(0.0f, 0.0f, 1.0f, 1.0f)
 The animation curve to use for controling the timing of the show/hide animations for the panel.
 
float animationTime = 0.4f
 The amount of time that show/hide animations should take to complete.
 
bool returnToOriginalPosition = true
 Whether the panel should return to its original starting position when shown (only applicable when using sliding animation modes). If false, the panel will just move into the canvas until it is fully visible when shown.
 
bool overrideFontSizeSettings = false
 Whether the panel should override the base dialogue font size settings for its child text components. When this is true, the font auto-sizing applied to each child text component will come from the min and max font size settings set on this component.
 
LanguageFontOverrides languageFontOverrides
 Whenever this is set to a LanguageFontOverrides asset, then whenever the language is switched, the fonts and font size settings used on child components of this component will be based on the settings in the LanguageFontOverrides.
 
int minFontSize = 0
 The minimum font size to use when auto-sizing child text components.
 
int maxFontSize = 64
 The maximum font size to use when auto-sizing child text components.
 
Coroutine showCoroutine
 A coroutine which runs when transitioning the panel to be shown.
 
Coroutine hideCoroutine
 A cortouine which runs when transitioning the panel to a be hidden.
 

Detailed Description

The DialoguePanel is an abstract component which provides a set of core features for components/panels which make up a dialogue display. Specifically, this class provides functionality for showing and hiding a dialogue panel and handling the animation associated with those actions.

Member Function Documentation

◆ Activate()

void EasyTalk.Display.DialoguePanel.Activate ( )

Sets the panel to be active, and recursively sets all parent game objects to be active.

◆ CancelHideRoutine()

void EasyTalk.Display.DialoguePanel.CancelHideRoutine ( )
private

Stops the coroutine for hiding the panel, if it's running.

◆ CancelShowRoutine()

void EasyTalk.Display.DialoguePanel.CancelShowRoutine ( )
private

Stops the coroutine for showing the panel, if it's running.

◆ Deactivate()

void EasyTalk.Display.DialoguePanel.Deactivate ( )

Makes the panel inactive.

◆ FadeDisplayIn()

IEnumerator EasyTalk.Display.DialoguePanel.FadeDisplayIn ( )
protected

Asynchronously fades the display and all of its child text and image components in to their original transparency values.

Returns

◆ FadeDisplayOut()

IEnumerator EasyTalk.Display.DialoguePanel.FadeDisplayOut ( bool deactivateAfterFade = true)
protected

Asynchronously fades the display and all of its child text and image components out to be completely transparent.

Parameters
deactivateAfterFadeWhether the panel should be set to inactive after the fade out animation has completed.
Returns

◆ ForceStandardText()

bool EasyTalk.Display.DialoguePanel.ForceStandardText ( )
Returns

◆ Hide()

virtual void EasyTalk.Display.DialoguePanel.Hide ( bool deactivateAfterHide = true)
virtual

Hides the panel.

Parameters
deactivateAfterHideWhether the panel should be set to inactive after it is hidden.

◆ HideImmediately()

void EasyTalk.Display.DialoguePanel.HideImmediately ( bool deactivateAfterHide = true)

Hides the panel immediately (doesn't use a transition animation).

Parameters
deactivateAfterHideWhether the panel should be set to inactive after it is hidden.

◆ Init()

virtual void EasyTalk.Display.DialoguePanel.Init ( )
virtual

Initializes the panel by storing the original position.

Reimplemented in EasyTalk.Display.DirectionalOptionDisplay, and EasyTalk.Display.OptionListDisplay.

◆ OnValidate()

void EasyTalk.Display.DialoguePanel.OnValidate ( )
private

Enables and disables TextMeshPro components and Unity standard Text components based on whether TextMeshPro is installed.

◆ Show()

virtual void EasyTalk.Display.DialoguePanel.Show ( )
virtual

Shows the panel.

◆ ShowImmediately()

void EasyTalk.Display.DialoguePanel.ShowImmediately ( )

Shows the panel immediately (doesn't use a transition animation).

◆ SlideDisplayIn()

IEnumerator EasyTalk.Display.DialoguePanel.SlideDisplayIn ( )
protected

Asynchronously slides the display into its Canvas' bounds. If returnToOriginalPosition is set to true, then the panel will slide to its original position.

Returns

◆ SlideDisplayOut()

IEnumerator EasyTalk.Display.DialoguePanel.SlideDisplayOut ( bool deactivateAfterSlide = true)
protected

Asynchronously slides the display out of its Canvas' bounds.

Parameters
deactivateAfterSlideWhether the panel should be set to inactive after the slide out animation has completed.
Returns

◆ WaitForAnimation()

IEnumerator EasyTalk.Display.DialoguePanel.WaitForAnimation ( )

Asynchronously waits for the currently running animation on this panel to complete.

Returns

Member Data Documentation

◆ animationCurve

AnimationCurve EasyTalk.Display.DialoguePanel.animationCurve = AnimationCurve.EaseInOut(0.0f, 0.0f, 1.0f, 1.0f)
private

The animation curve to use for controling the timing of the show/hide animations for the panel.

◆ animationTime

float EasyTalk.Display.DialoguePanel.animationTime = 0.4f
private

The amount of time that show/hide animations should take to complete.

◆ animationType

UIAnimator.Animation EasyTalk.Display.DialoguePanel.animationType = UIAnimator.Animation.NONE
private

The animation type to use when hiding/showing the panel.

◆ displayID

string EasyTalk.Display.DialoguePanel.displayID = null
private

The display ID of the panel.

◆ forceStandardText

bool EasyTalk.Display.DialoguePanel.forceStandardText = false
protected

Whether the Display uses standard Text components rather than TextMeshPro components, even with TextMeshPro installed.

◆ hideCoroutine

Coroutine EasyTalk.Display.DialoguePanel.hideCoroutine
private

A cortouine which runs when transitioning the panel to a be hidden.

◆ isHidden

bool EasyTalk.Display.DialoguePanel.isHidden = false
protected

Whether the panel is currently hidden.

◆ languageFontOverrides

LanguageFontOverrides EasyTalk.Display.DialoguePanel.languageFontOverrides
private

Whenever this is set to a LanguageFontOverrides asset, then whenever the language is switched, the fonts and font size settings used on child components of this component will be based on the settings in the LanguageFontOverrides.

◆ maxFontSize

int EasyTalk.Display.DialoguePanel.maxFontSize = 64
private

The maximum font size to use when auto-sizing child text components.

◆ minFontSize

int EasyTalk.Display.DialoguePanel.minFontSize = 0
private

The minimum font size to use when auto-sizing child text components.

◆ onHideComplete

UnityEvent EasyTalk.Display.DialoguePanel.onHideComplete = new UnityEvent()

An event which is triggered whenever the panel has finished transitioning to a hidden state.

◆ onHideStart

UnityEvent EasyTalk.Display.DialoguePanel.onHideStart = new UnityEvent()

An event which is triggered whenever the panel starts being hidden.

◆ onShowComplete

UnityEvent EasyTalk.Display.DialoguePanel.onShowComplete = new UnityEvent()

An event which is triggered whenever the panel has finished transitioning to a shown state.

◆ onShowStart

UnityEvent EasyTalk.Display.DialoguePanel.onShowStart = new UnityEvent()

An event which is triggered whenever the panel starts being shown.

◆ originalPosition

Vector3 EasyTalk.Display.DialoguePanel.originalPosition = Vector3.zero
protected

The original position of the panel.

◆ overrideFontSizeSettings

bool EasyTalk.Display.DialoguePanel.overrideFontSizeSettings = false
private

Whether the panel should override the base dialogue font size settings for its child text components. When this is true, the font auto-sizing applied to each child text component will come from the min and max font size settings set on this component.

◆ returnToOriginalPosition

bool EasyTalk.Display.DialoguePanel.returnToOriginalPosition = true
private

Whether the panel should return to its original starting position when shown (only applicable when using sliding animation modes). If false, the panel will just move into the canvas until it is fully visible when shown.

◆ showCoroutine

Coroutine EasyTalk.Display.DialoguePanel.showCoroutine
private

A coroutine which runs when transitioning the panel to be shown.

Property Documentation

◆ AnimationType

UIAnimator.Animation EasyTalk.Display.DialoguePanel.AnimationType
getset

Gets or sets the animation type used for showing and hiding the panel.

◆ DisplayID

string EasyTalk.Display.DialoguePanel.DisplayID
getset

Gets or sets the Display ID of the panel.

◆ IsHidden

bool EasyTalk.Display.DialoguePanel.IsHidden
get

Gets whether the panel is currently hidden.

◆ LanguageFontOverrides

LanguageFontOverrides EasyTalk.Display.DialoguePanel.LanguageFontOverrides
getset

Gets or sets the LanguageFontOverrides to use on the component.

Implements EasyTalk.Display.LocalizableComponent.

◆ MaxFontSize

int EasyTalk.Display.DialoguePanel.MaxFontSize
getset

Gets or sets the maximum font size to use on the component.

Implements EasyTalk.Display.LocalizableComponent.

◆ MinFontSize

int EasyTalk.Display.DialoguePanel.MinFontSize
getset

Gets or sets the minimum font size to use on the component.

Implements EasyTalk.Display.LocalizableComponent.

◆ OriginalPosition

Vector3 EasyTalk.Display.DialoguePanel.OriginalPosition
get

Gets the original position of the panel.

◆ OverrideFontSizes

bool EasyTalk.Display.DialoguePanel.OverrideFontSizes
getset

Gets or sets whether the component should override the default font sizes.

Implements EasyTalk.Display.LocalizableComponent.