v3.11.4 Documentation
Fungus.SayDialog Class Reference

Display story text in a visual novel style dialog box. More...

Inheritance diagram for Fungus.SayDialog:

Public Member Functions

virtual void SetActive (bool state)
 Sets the active state of the Say Dialog gameobject. More...
 
virtual void SetCharacter (Character character)
 Sets the active speaking character. More...
 
virtual void SetCharacterImage (Sprite image)
 Sets the character image to display on the Say Dialog. More...
 
virtual void SetCharacterName (string name, Color color)
 Sets the character name to display on the Say Dialog. More...
 
virtual void Say (string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, bool waitForVO, AudioClip voiceOverClip, Action onComplete)
 Write a line of story text to the Say Dialog. More...
 
virtual IEnumerator DoSay (string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, bool waitForVO, AudioClip voiceOverClip, Action onComplete)
 Write a line of story text to the Say Dialog. More...
 
virtual void Stop ()
 Stop the Say Dialog while its writing text. More...
 
virtual void Clear ()
 Stops writing text and clears the Say Dialog. More...
 

Static Public Member Functions

static SayDialog GetSayDialog ()
 Returns a SayDialog by searching for one in the scene or creating one if none exists. More...
 
static void StopPortraitTweens ()
 Stops all active portrait tweens. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void OnDestroy ()
 
virtual Writer GetWriter ()
 
virtual CanvasGroup GetCanvasGroup ()
 
virtual WriterAudio GetWriterAudio ()
 
virtual void Start ()
 
virtual void LateUpdate ()
 
virtual void UpdateAlpha ()
 
virtual void ClearStoryText ()
 

Protected Attributes

float fadeDuration = 0.25f
 
Button continueButton
 
Canvas dialogCanvas
 
Text nameText
 
GameObject nameTextGO
 
TextAdapter nameTextAdapter = new TextAdapter()
 
Text storyText
 
GameObject storyTextGO
 
TextAdapter storyTextAdapter = new TextAdapter()
 
Image characterImage
 
bool fitTextWithImage = true
 
bool closeOtherDialogs
 
float startStoryTextWidth
 
float startStoryTextInset
 
WriterAudio writerAudio
 
Writer writer
 
CanvasGroup canvasGroup
 
bool fadeWhenDone = true
 
float targetAlpha = 0f
 
float fadeCoolDownTimer = 0f
 
Sprite currentCharacterImage
 
StringSubstituter stringSubstituter = new StringSubstituter()
 

Static Protected Attributes

static Character speakingCharacter
 
static List< SayDialogactiveSayDialogs = new List<SayDialog>()
 

Properties

virtual string NameText [get, set]
 
virtual string StoryText [get, set]
 
virtual RectTransform StoryTextRectTrans [get]
 
virtual Image CharacterImage [get]
 
Character SpeakingCharacter [get]
 
static SayDialog ActiveSayDialog [get, set]
 Currently active Say Dialog used to display Say text More...
 
virtual bool FadeWhenDone [get, set]
 Tell the Say Dialog to fade out once writing and player input have finished. More...
 

Detailed Description

Display story text in a visual novel style dialog box.

Definition at line 15 of file SayDialog.cs.

Member Function Documentation

◆ Awake()

virtual void Fungus.SayDialog.Awake ( )
protectedvirtual

Definition at line 98 of file SayDialog.cs.

◆ Clear()

virtual void Fungus.SayDialog.Clear ( )
virtual

Stops writing text and clears the Say Dialog.

Definition at line 542 of file SayDialog.cs.

◆ ClearStoryText()

virtual void Fungus.SayDialog.ClearStoryText ( )
protectedvirtual

Definition at line 236 of file SayDialog.cs.

◆ DoSay()

virtual IEnumerator Fungus.SayDialog.DoSay ( string  text,
bool  clearPrevious,
bool  waitForInput,
bool  fadeWhenDone,
bool  stopVoiceover,
bool  waitForVO,
AudioClip  voiceOverClip,
Action  onComplete 
)
virtual

Write a line of story text to the Say Dialog.

Must be started as a coroutine.

Parameters
textThe text to display.
clearPreviousClear any previous text in the Say Dialog.
waitForInputWait for player input before continuing once text is written.
fadeWhenDoneFade out the Say Dialog when writing and player input has finished.
stopVoiceoverStop any existing voiceover audio before writing starts.
voiceOverClipVoice over audio clip to play.
onCompleteCallback to execute when writing and player input have finished.

Definition at line 479 of file SayDialog.cs.

◆ GetCanvasGroup()

virtual CanvasGroup Fungus.SayDialog.GetCanvasGroup ( )
protectedvirtual

Definition at line 130 of file SayDialog.cs.

◆ GetSayDialog()

static SayDialog Fungus.SayDialog.GetSayDialog ( )
static

Returns a SayDialog by searching for one in the scene or creating one if none exists.

Definition at line 253 of file SayDialog.cs.

◆ GetWriter()

virtual Writer Fungus.SayDialog.GetWriter ( )
protectedvirtual

Definition at line 114 of file SayDialog.cs.

◆ GetWriterAudio()

virtual WriterAudio Fungus.SayDialog.GetWriterAudio ( )
protectedvirtual

Definition at line 146 of file SayDialog.cs.

◆ LateUpdate()

virtual void Fungus.SayDialog.LateUpdate ( )
protectedvirtual

Definition at line 189 of file SayDialog.cs.

◆ OnDestroy()

virtual void Fungus.SayDialog.OnDestroy ( )
protectedvirtual

Definition at line 109 of file SayDialog.cs.

◆ Say()

virtual void Fungus.SayDialog.Say ( string  text,
bool  clearPrevious,
bool  waitForInput,
bool  fadeWhenDone,
bool  stopVoiceover,
bool  waitForVO,
AudioClip  voiceOverClip,
Action  onComplete 
)
virtual

Write a line of story text to the Say Dialog.

Starts coroutine automatically.

Parameters
textThe text to display.
clearPreviousClear any previous text in the Say Dialog.
waitForInputWait for player input before continuing once text is written.
fadeWhenDoneFade out the Say Dialog when writing and player input has finished.
stopVoiceoverStop any existing voiceover audio before writing starts.
voiceOverClipVoice over audio clip to play.
onCompleteCallback to execute when writing and player input have finished.

Definition at line 464 of file SayDialog.cs.

◆ SetActive()

virtual void Fungus.SayDialog.SetActive ( bool  state)
virtual

Sets the active state of the Say Dialog gameobject.

Definition at line 319 of file SayDialog.cs.

◆ SetCharacter()

virtual void Fungus.SayDialog.SetCharacter ( Character  character)
virtual

Sets the active speaking character.

Parameters
characterThe active speaking character.

Definition at line 328 of file SayDialog.cs.

◆ SetCharacterImage()

virtual void Fungus.SayDialog.SetCharacterImage ( Sprite  image)
virtual

Sets the character image to display on the Say Dialog.

Definition at line 388 of file SayDialog.cs.

◆ SetCharacterName()

virtual void Fungus.SayDialog.SetCharacterName ( string  name,
Color  color 
)
virtual

Sets the character name to display on the Say Dialog.

Supports variable substitution e.g. John {$surname}

Definition at line 444 of file SayDialog.cs.

◆ Start()

virtual void Fungus.SayDialog.Start ( )
protectedvirtual

Definition at line 162 of file SayDialog.cs.

◆ Stop()

virtual void Fungus.SayDialog.Stop ( )
virtual

Stop the Say Dialog while its writing text.

Definition at line 533 of file SayDialog.cs.

◆ StopPortraitTweens()

static void Fungus.SayDialog.StopPortraitTweens ( )
static

Stops all active portrait tweens.

Definition at line 290 of file SayDialog.cs.

◆ UpdateAlpha()

virtual void Fungus.SayDialog.UpdateAlpha ( )
protectedvirtual

Definition at line 199 of file SayDialog.cs.

Member Data Documentation

◆ activeSayDialogs

List<SayDialog> Fungus.SayDialog.activeSayDialogs = new List<SayDialog>()
staticprotected

Definition at line 96 of file SayDialog.cs.

◆ canvasGroup

CanvasGroup Fungus.SayDialog.canvasGroup
protected

Definition at line 82 of file SayDialog.cs.

◆ characterImage

Image Fungus.SayDialog.characterImage
protected

Definition at line 68 of file SayDialog.cs.

◆ closeOtherDialogs

bool Fungus.SayDialog.closeOtherDialogs
protected

Definition at line 75 of file SayDialog.cs.

◆ continueButton

Button Fungus.SayDialog.continueButton
protected

Definition at line 21 of file SayDialog.cs.

◆ currentCharacterImage

Sprite Fungus.SayDialog.currentCharacterImage
protected

Definition at line 88 of file SayDialog.cs.

◆ dialogCanvas

Canvas Fungus.SayDialog.dialogCanvas
protected

Definition at line 24 of file SayDialog.cs.

◆ fadeCoolDownTimer

float Fungus.SayDialog.fadeCoolDownTimer = 0f
protected

Definition at line 86 of file SayDialog.cs.

◆ fadeDuration

float Fungus.SayDialog.fadeDuration = 0.25f
protected

Definition at line 18 of file SayDialog.cs.

◆ fadeWhenDone

bool Fungus.SayDialog.fadeWhenDone = true
protected

Definition at line 84 of file SayDialog.cs.

◆ fitTextWithImage

bool Fungus.SayDialog.fitTextWithImage = true
protected

Definition at line 72 of file SayDialog.cs.

◆ nameText

Text Fungus.SayDialog.nameText
protected

Definition at line 27 of file SayDialog.cs.

◆ nameTextAdapter

TextAdapter Fungus.SayDialog.nameTextAdapter = new TextAdapter()
protected

Definition at line 30 of file SayDialog.cs.

◆ nameTextGO

GameObject Fungus.SayDialog.nameTextGO
protected

Definition at line 29 of file SayDialog.cs.

◆ speakingCharacter

Character Fungus.SayDialog.speakingCharacter
staticprotected

Definition at line 91 of file SayDialog.cs.

◆ startStoryTextInset

float Fungus.SayDialog.startStoryTextInset
protected

Definition at line 78 of file SayDialog.cs.

◆ startStoryTextWidth

float Fungus.SayDialog.startStoryTextWidth
protected

Definition at line 77 of file SayDialog.cs.

◆ storyText

Text Fungus.SayDialog.storyText
protected

Definition at line 44 of file SayDialog.cs.

◆ storyTextAdapter

TextAdapter Fungus.SayDialog.storyTextAdapter = new TextAdapter()
protected

Definition at line 47 of file SayDialog.cs.

◆ storyTextGO

GameObject Fungus.SayDialog.storyTextGO
protected

Definition at line 46 of file SayDialog.cs.

◆ stringSubstituter

StringSubstituter Fungus.SayDialog.stringSubstituter = new StringSubstituter()
protected

Definition at line 93 of file SayDialog.cs.

◆ targetAlpha

float Fungus.SayDialog.targetAlpha = 0f
protected

Definition at line 85 of file SayDialog.cs.

◆ writer

Writer Fungus.SayDialog.writer
protected

Definition at line 81 of file SayDialog.cs.

◆ writerAudio

WriterAudio Fungus.SayDialog.writerAudio
protected

Definition at line 80 of file SayDialog.cs.

Property Documentation

◆ ActiveSayDialog

SayDialog Fungus.SayDialog.ActiveSayDialog
staticgetset

Currently active Say Dialog used to display Say text

Definition at line 248 of file SayDialog.cs.

◆ CharacterImage

virtual Image Fungus.SayDialog.CharacterImage
get

Definition at line 69 of file SayDialog.cs.

◆ FadeWhenDone

virtual bool Fungus.SayDialog.FadeWhenDone
getset

Tell the Say Dialog to fade out once writing and player input have finished.

Definition at line 528 of file SayDialog.cs.

◆ NameText

virtual string Fungus.SayDialog.NameText
getset

Definition at line 32 of file SayDialog.cs.

◆ SpeakingCharacter

Character Fungus.SayDialog.SpeakingCharacter
get

Definition at line 243 of file SayDialog.cs.

◆ StoryText

virtual string Fungus.SayDialog.StoryText
getset

Definition at line 49 of file SayDialog.cs.

◆ StoryTextRectTrans

virtual RectTransform Fungus.SayDialog.StoryTextRectTrans
get

Definition at line 60 of file SayDialog.cs.


The documentation for this class was generated from the following file: