Adventure Creator  1.68.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.SpeechManager Class Reference
Inheritance diagram for AC.SpeechManager:

Public Member Functions

delegate string GetAutoAssetPathAndNameDelegate (SpeechLine speechLine, string language, bool forLipSync)
 
void ShowGUI ()
 
string [] GetSceneNames ()
 
void ClearLanguages ()
 
void LocateLine (SpeechLine speechLine)
 
void PopulateList (bool currentSceneOnly=false)
 
ActionListAsset [] GetAllActionListAssets ()
 Gets all ActionList assets referenced by scenes, Managers and other asset files in the project More...
 
SpeechTag GetSpeechTag (int ID)
 Gets a defined SpeechTag. More...
 
void ConvertLocalVariableToGlobal (GVar variable, int newGlobalID)
 Converts the Speech Managers's references from a given local variable to a given global variable More...
 
void ConvertGlobalVariableToLocal (GVar variable, string sceneName)
 Converts the Speech Managers's references from a given global variable to a given local variable More...
 
string GetLineFilename (int _lineID, string speakerName="")
 Gets the audio filename of a SpeechLine. More...
 
string GetAutoAssetPathAndName (int lineID, Char speaker, string language, bool forLipsync=false)
 Gets the full folder and filename for a speech line's audio or lipsync file, relative to the "Resources" Assets directory in which it is placed. More...
 
SpeechLine GetLine (int _lineID)
 Gets a SpeechLine class, as generated by the Speech Manager. More...
 
bool UseFileBasedLipSyncing ()
 Checks if the current lipsyncing method relies on external text files for each line. More...
 

Public Attributes

bool scrollSubtitles = true
 
bool scrollNarration = false
 
float textScrollSpeed = 50
 
AudioClip textScrollCLip = null
 
AudioClip narrationTextScrollCLip = null
 
bool playScrollAudioEveryCharacter = true
 
bool displayForever = false
 
bool displayNarrationForever = false
 
bool playAnimationForever = true
 
bool canSkipWithMouseClicks = true
 
float minimumDisplayTime = 1f
 
float screenTimeFactor = 0.1f
 
bool allowSpeechSkipping = false
 
bool allowGameplaySpeechSkipping = false
 
float skipThresholdTime = 0f
 
bool endScrollBeforeSkip = false
 
bool scrollingTextFactorsLength = false
 
bool useAssetBundles = false
 
bool searchAudioFiles = true
 
bool autoNameSpeechFiles = true
 
string autoSpeechFolder = "Speech"
 
string autoLipsyncFolder = "Lipsync"
 
bool forceSubtitles = true
 
bool translateAudio = true
 
bool separateVoiceAndTextLanguages = false
 
bool fallbackAudio = false
 
bool keepTextInBuffer = false
 
bool relegateBackgroundSpeechAudio = false
 
bool usePlayerRealName = false
 
bool separateSharedPlayerAudio = false
 
bool placeAudioInSubfolders = false
 
bool separateLines = false
 
float separateLinePause = 1f
 
bool resetExpressionsEachLine = true
 
List< SpeechLinelines = new List<SpeechLine> ()
 
List< string > languages = new List<string> ()
 
List< bool > languageIsRightToLeft = new List<bool> ()
 
List< string > languageAudioAssetBundles = new List<string>()
 
List< string > languageLipsyncAssetBundles = new List<string>()
 
bool ignoreOriginalText = false
 
float sfxDucking = 0f
 
float musicDucking = 0f
 
LipSyncMode lipSyncMode = LipSyncMode.Off
 
LipSyncOutput lipSyncOutput = LipSyncOutput.Portrait
 
List< string > phonemes = new List<string> ()
 
float lipSyncSpeed = 1f
 
GetAutoAssetPathAndNameDelegate GetAutoAssetPathAndNameOverride
 
int maxID = -1
 
SpeechIDRecycling speechIDRecycling = SpeechIDRecycling.NeverRecycle
 
string [] sceneFiles
 
int activeLineID = -1
 
bool mergeMatchingSpeechIDs = false
 
bool useSpeechTags = false
 
List< SpeechTagspeechTags = new List<SpeechTag>()
 

Properties

string AutoSpeechFolder [get]
 
string AutoLipsyncFolder [get]
 

Detailed Description

Handles the "Speech" tab of the Game Editor window. All translations for a game's text are stored here, as are the settings that control how speech is handled in-game.

Member Function Documentation

◆ ClearLanguages()

void AC.SpeechManager.ClearLanguages ( )

Removes all translations.

◆ ConvertGlobalVariableToLocal()

void AC.SpeechManager.ConvertGlobalVariableToLocal ( GVar  variable,
string  sceneName 
)

Converts the Speech Managers's references from a given global variable to a given local variable

Parameters
variableThe old global variable
sceneNameThe name of the scene that the new variable lives in

◆ ConvertLocalVariableToGlobal()

void AC.SpeechManager.ConvertLocalVariableToGlobal ( GVar  variable,
int  newGlobalID 
)

Converts the Speech Managers's references from a given local variable to a given global variable

Parameters
variableThe old local variable
newGlobalIDThe ID number of the new global variable

◆ GetAllActionListAssets()

ActionListAsset [] AC.SpeechManager.GetAllActionListAssets ( )

Gets all ActionList assets referenced by scenes, Managers and other asset files in the project

Returns
All ActionList assets referenced by scenes, Managers and other asset files in the project

◆ GetAutoAssetPathAndName()

string AC.SpeechManager.GetAutoAssetPathAndName ( int  lineID,
Char  speaker,
string  language,
bool  forLipsync = false 
)

Gets the full folder and filename for a speech line's audio or lipsync file, relative to the "Resources" Assets directory in which it is placed.

Parameters
lineIDThe ID number of the speech line
speakerThe speaking character, if not a narration
languageThe language of the audio
forLipSyncTrue if this is for a lipsync file
Returns
A string of the folder name that the audio or lipsync file should be placed in

◆ GetAutoAssetPathAndNameDelegate()

delegate string AC.SpeechManager.GetAutoAssetPathAndNameDelegate ( SpeechLine  speechLine,
string  language,
bool  forLipSync 
)

A delegate template for overriding the GetAutoAssetPathAndName function

◆ GetLine()

SpeechLine AC.SpeechManager.GetLine ( int  _lineID)

Gets a SpeechLine class, as generated by the Speech Manager.

Parameters
_lineIDThe translation ID number generated by SpeechManager's PopulateList() function
Returns
The generated SpeechLine class

◆ GetLineFilename()

string AC.SpeechManager.GetLineFilename ( int  _lineID,
string  speakerName = "" 
)

Gets the audio filename of a SpeechLine.

Parameters
_lineIDThe translation ID number generated by SpeechManager's PopulateList() function
speakerNameThe name of the speaking character, which is only used if separating shared player audio
Returns
The audio filename of the speech line

◆ GetSpeechTag()

SpeechTag AC.SpeechManager.GetSpeechTag ( int  ID)

Gets a defined SpeechTag.

Parameters
IDThe ID number of the SpeechTag to get
Returns
The SpeechTag

◆ ShowGUI()

void AC.SpeechManager.ShowGUI ( )

Shows the GUI.

◆ UseFileBasedLipSyncing()

bool AC.SpeechManager.UseFileBasedLipSyncing ( )

Checks if the current lipsyncing method relies on external text files for each line.

Returns
True if the current lipsyncing method relies on external text files for each line.

Member Data Documentation

◆ activeLineID

int AC.SpeechManager.activeLineID = -1

The current SpeechLine selected to reveal its properties

◆ allowGameplaySpeechSkipping

bool AC.SpeechManager.allowGameplaySpeechSkipping = false

If True, then speech text during gameplay can be skipped by the player left-clicking

◆ allowSpeechSkipping

bool AC.SpeechManager.allowSpeechSkipping = false

If True, then speech text during a cutscene can be skipped by the player left-clicking

◆ autoLipsyncFolder

string AC.SpeechManager.autoLipsyncFolder = "Lipsync"

The subdirectory within Resources that lipsync files are pulled from, if autoNameSpeechFiles = True

◆ autoNameSpeechFiles

bool AC.SpeechManager.autoNameSpeechFiles = true

If True, then the audio files associated with speech text will be named automatically according to their ID number

◆ autoSpeechFolder

string AC.SpeechManager.autoSpeechFolder = "Speech"

The subdirectory within Resources that speech files are pulled from, if autoNameSpeechFiles = True

◆ canSkipWithMouseClicks

bool AC.SpeechManager.canSkipWithMouseClicks = true

If True, and subtitles can be skipped, then skipping can be achieved with mouse-clicks, as well as by invoking the SkipSpeech input

◆ displayForever

bool AC.SpeechManager.displayForever = false

If True, then speech text will remain on the screen until the player skips it

◆ displayNarrationForever

bool AC.SpeechManager.displayNarrationForever = false

If true, then narration text will remain on the screen until the player skips it. This only has an effect if displayForever = false

◆ endScrollBeforeSkip

bool AC.SpeechManager.endScrollBeforeSkip = false

If True, then left-clicking will complete any scrolling speech text

◆ fallbackAudio

bool AC.SpeechManager.fallbackAudio = false

If True, then translations that don't have speech audio files will use the audio files from the game's original language

◆ forceSubtitles

bool AC.SpeechManager.forceSubtitles = true

If True, then speech text will always display if no relevant audio file is found - even if Subtitles are off in the Options menu

◆ GetAutoAssetPathAndNameOverride

GetAutoAssetPathAndNameDelegate AC.SpeechManager.GetAutoAssetPathAndNameOverride

An override delegate for the GetAutoAssetPathAndName function, used to retrieve the full filepath of an auto-assigned speech audio or lipsync file

◆ ignoreOriginalText

bool AC.SpeechManager.ignoreOriginalText = false

If True, then the game's original text cannot be displayed in-game, and only translations will be available

◆ keepTextInBuffer

bool AC.SpeechManager.keepTextInBuffer = false

If True, then the text stored in the speech buffer (in MenuLabel) will not be cleared when no speech text is active

◆ languageAudioAssetBundles

List<string> AC.SpeechManager.languageAudioAssetBundles = new List<string>()

A collection of AssetBundles to store each language's speech audio files

◆ languageIsRightToLeft

List<bool> AC.SpeechManager.languageIsRightToLeft = new List<bool> ()

A List of whether or not each language in the game reads right-to-left (Arabic / Hebrew-style)

◆ languageLipsyncAssetBundles

List<string> AC.SpeechManager.languageLipsyncAssetBundles = new List<string>()

A collection of AssetBundles to store each language's speech lipsync files

◆ languages

List<string> AC.SpeechManager.languages = new List<string> ()

The names of the game's languages. The first is always "Original".

◆ lines

List<SpeechLine> AC.SpeechManager.lines = new List<SpeechLine> ()

All SpeechLines generated to store translations and audio filename references

◆ lipSyncMode

LipSyncMode AC.SpeechManager.lipSyncMode = LipSyncMode.Off

The game's lip-syncing method (Off, FromSpeechText, ReadPamelaFile, ReadSapiFile, ReadPapagayoFile, FaceFX, Salsa2D)

◆ lipSyncOutput

LipSyncOutput AC.SpeechManager.lipSyncOutput = LipSyncOutput.Portrait

What lip-syncing actually affects (Portrait, PortraitAndGameObject, GameObjectTexture)

◆ lipSyncSpeed

float AC.SpeechManager.lipSyncSpeed = 1f

The speed at which to process lip-sync data

◆ maxID

int AC.SpeechManager.maxID = -1

A record of the highest-used ID number

◆ mergeMatchingSpeechIDs

bool AC.SpeechManager.mergeMatchingSpeechIDs = false

If True, then speech lines that are exactly the same will share the same ID number

◆ minimumDisplayTime

float AC.SpeechManager.minimumDisplayTime = 1f

The minimum time, in seconds, that a speech line will be displayed (unless an AudioClip is setting it's length)

◆ musicDucking

float AC.SpeechManager.musicDucking = 0f

The factor by which to reduce music audio when speech plays

◆ narrationTextScrollCLip

AudioClip AC.SpeechManager.narrationTextScrollCLip = null

The AudioClip to play when scrolling narration text

◆ phonemes

List<string> AC.SpeechManager.phonemes = new List<string> ()

The phoneme bins used to separate phonemes into animation frames

◆ placeAudioInSubfolders

bool AC.SpeechManager.placeAudioInSubfolders = false

If True, then speech audio files will need to be placed in subfolders named after the character who speaks

◆ playAnimationForever

bool AC.SpeechManager.playAnimationForever = true

If True, and displayForever = True, then a speaking character will play their talking animation for the whole duration that their speech text is alive

◆ playScrollAudioEveryCharacter

bool AC.SpeechManager.playScrollAudioEveryCharacter = true

If True, the textScrollClip audio will be played with every character addition to the subtitle text, as opposed to waiting for the previous audio to end

◆ relegateBackgroundSpeechAudio

bool AC.SpeechManager.relegateBackgroundSpeechAudio = false

If True, then background speech audio will end if foreground speech audio begins to play

◆ resetExpressionsEachLine

bool AC.SpeechManager.resetExpressionsEachLine = true

If True, then a character's expression will be reset with each new speech line

◆ sceneFiles

string [] AC.SpeechManager.sceneFiles

An array of all scene names in the Build settings

◆ screenTimeFactor

float AC.SpeechManager.screenTimeFactor = 0.1f

The time that speech text will be displayed, divided by the number of characters in the text, if displayForever = False

◆ scrollingTextFactorsLength

bool AC.SpeechManager.scrollingTextFactorsLength = false

If True, and text is scrolling, then the display time upon completion will be influenced by the length of the speech text

◆ scrollNarration

bool AC.SpeechManager.scrollNarration = false

If True, then narration text will scroll when displayed

◆ scrollSubtitles

bool AC.SpeechManager.scrollSubtitles = true

If True, then speech text will scroll when displayed

◆ searchAudioFiles

bool AC.SpeechManager.searchAudioFiles = true

If True, then speech audio files will play when characters speak

◆ separateLinePause

float AC.SpeechManager.separateLinePause = 1f

The delay between carriage return-separated speech lines, if separateLines = True

◆ separateLines

bool AC.SpeechManager.separateLines = false

If True, then a speech line will be split by carriage returns into separate speech lines

◆ separateSharedPlayerAudio

bool AC.SpeechManager.separateSharedPlayerAudio = false

If True, usePlayerRealName = True, autoNameSpeechFiles = True, and playerSwitching = PlayerSwitching.Allow in SettingsManager, then speech lines marked as Player lines will have audio entries for each player prefab.

◆ separateVoiceAndTextLanguages

bool AC.SpeechManager.separateVoiceAndTextLanguages = false

If True, then the current voice audio language can be set independently of the the current text language.

◆ sfxDucking

float AC.SpeechManager.sfxDucking = 0f

The factor by which to reduce SFX audio when speech plays

◆ skipThresholdTime

float AC.SpeechManager.skipThresholdTime = 0f

The minimum time that speech text must be displayed before it can be skipped, if allowSpeechSkipping = True

◆ speechIDRecycling

SpeechIDRecycling AC.SpeechManager.speechIDRecycling = SpeechIDRecycling.NeverRecycle

The rule to use when assigning new ID numbers (NeverRecycle, AlwaysRecycle, OnlyRecycleHighest

◆ speechTags

List<SpeechTag> AC.SpeechManager.speechTags = new List<SpeechTag>()

A List of the available SpeechTags

◆ textScrollCLip

AudioClip AC.SpeechManager.textScrollCLip = null

The AudioClip to play when scrolling speech text

◆ textScrollSpeed

float AC.SpeechManager.textScrollSpeed = 50

The speed of scrolling text

◆ translateAudio

bool AC.SpeechManager.translateAudio = true

If True, then each translation will have its own set of speech audio files

◆ useAssetBundles

bool AC.SpeechManager.useAssetBundles = false

If True, then asset bundles will be used to store speech files

◆ usePlayerRealName

bool AC.SpeechManager.usePlayerRealName = false

If True, then speech audio spoken by the player will expect the audio filenames to be named after the player's prefab, rather than just "Player"

◆ useSpeechTags

bool AC.SpeechManager.useSpeechTags = false

If True, then 'Dialogue: Play speech' Actions can be assigned a SpeechTag, or label, to use when exporting script sheets