C# Class Fungus.SayDialog

Inheritance: Fungus.Dialog
Show file Open project: snozbot/fungus Class Usage Examples

Protected Properties

Property Type Description
activeSayDialogs List
canvasGroup CanvasGroup
currentCharacterImage Sprite
fadeCoolDownTimer float
fadeWhenDone bool
speakingCharacter Character
startStoryTextInset float
startStoryTextWidth float
stringSubstituter StringSubstituter
targetAlpha float
writer Writer
writerAudio WriterAudio

Public Methods

Method Description
Clear ( ) : void

Stops writing text and clears the Say Dialog.

DoSay ( string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, System.Action onComplete ) : IEnumerator

Write a line of story text to the Say Dialog. Must be started as a coroutine.

GetSayDialog ( ) : SayDialog

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

Say ( string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, Action onComplete ) : void

Write a line of story text to the Say Dialog. Starts coroutine automatically.

SetActive ( bool state ) : void

Sets the active state of the Say Dialog gameobject.

SetCharacter ( Character character ) : void

Sets the active speaking character.

SetCharacterImage ( Sprite image ) : void

Sets the character image to display on the Say Dialog.

SetCharacterName ( string name, Color color ) : void

Sets the character name to display on the Say Dialog. Supports variable substitution e.g. John {$surname}

Stop ( ) : void

Stop the Say Dialog while its writing text.

StopPortraitTweens ( ) : void

Stops all active portrait tweens.

Protected Methods

Method Description
Awake ( ) : void
ClearStoryText ( ) : void
GetCanvasGroup ( ) : CanvasGroup
GetWriter ( ) : Writer
GetWriterAudio ( ) : WriterAudio
LateUpdate ( ) : void
OnDestroy ( ) : void
Start ( ) : void
UpdateAlpha ( ) : void

Method Details

Awake() protected method

protected Awake ( ) : void
return void

Clear() public method

Stops writing text and clears the Say Dialog.
public Clear ( ) : void
return void

ClearStoryText() protected method

protected ClearStoryText ( ) : void
return void

DoSay() public method

Write a line of story text to the Say Dialog. Must be started as a coroutine.
public DoSay ( string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, System.Action onComplete ) : IEnumerator
text string The text to display.
clearPrevious bool Clear any previous text in the Say Dialog.
waitForInput bool Wait for player input before continuing once text is written.
fadeWhenDone bool Fade out the Say Dialog when writing and player input has finished.
stopVoiceover bool Stop any existing voiceover audio before writing starts.
voiceOverClip UnityEngine.AudioClip Voice over audio clip to play.
onComplete System.Action Callback to execute when writing and player input have finished.
return IEnumerator

GetCanvasGroup() protected method

protected GetCanvasGroup ( ) : CanvasGroup
return UnityEngine.CanvasGroup

GetSayDialog() public static method

Returns a SayDialog by searching for one in the scene or creating one if none exists.
public static GetSayDialog ( ) : SayDialog
return SayDialog

GetWriter() protected method

protected GetWriter ( ) : Writer
return Writer

GetWriterAudio() protected method

protected GetWriterAudio ( ) : WriterAudio
return WriterAudio

LateUpdate() protected method

protected LateUpdate ( ) : void
return void

OnDestroy() protected method

protected OnDestroy ( ) : void
return void

Say() public method

Write a line of story text to the Say Dialog. Starts coroutine automatically.
public Say ( string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, Action onComplete ) : void
text string The text to display.
clearPrevious bool Clear any previous text in the Say Dialog.
waitForInput bool Wait for player input before continuing once text is written.
fadeWhenDone bool Fade out the Say Dialog when writing and player input has finished.
stopVoiceover bool Stop any existing voiceover audio before writing starts.
voiceOverClip AudioClip Voice over audio clip to play.
onComplete Action Callback to execute when writing and player input have finished.
return void

SetActive() public method

Sets the active state of the Say Dialog gameobject.
public SetActive ( bool state ) : void
state bool
return void

SetCharacter() public method

Sets the active speaking character.
public SetCharacter ( Character character ) : void
character Character The active speaking character.
return void

SetCharacterImage() public method

Sets the character image to display on the Say Dialog.
public SetCharacterImage ( Sprite image ) : void
image Sprite
return void

SetCharacterName() public method

Sets the character name to display on the Say Dialog. Supports variable substitution e.g. John {$surname}
public SetCharacterName ( string name, Color color ) : void
name string
color Color
return void

Start() protected method

protected Start ( ) : void
return void

Stop() public method

Stop the Say Dialog while its writing text.
public Stop ( ) : void
return void

StopPortraitTweens() public static method

Stops all active portrait tweens.
public static StopPortraitTweens ( ) : void
return void

UpdateAlpha() protected method

protected UpdateAlpha ( ) : void
return void

Property Details

activeSayDialogs protected static property

protected static List activeSayDialogs
return List

canvasGroup protected property

protected CanvasGroup canvasGroup
return CanvasGroup

currentCharacterImage protected property

protected Sprite currentCharacterImage
return Sprite

fadeCoolDownTimer protected property

protected float fadeCoolDownTimer
return float

fadeWhenDone protected property

protected bool fadeWhenDone
return bool

speakingCharacter protected static property

protected static Character speakingCharacter
return Character

startStoryTextInset protected property

protected float startStoryTextInset
return float

startStoryTextWidth protected property

protected float startStoryTextWidth
return float

stringSubstituter protected property

protected StringSubstituter stringSubstituter
return StringSubstituter

targetAlpha protected property

protected float targetAlpha
return float

writer protected property

protected Writer writer
return Writer

writerAudio protected property

protected WriterAudio writerAudio
return WriterAudio