Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.SpeechManager Class Reference
Inheritance diagram for AC.SpeechManager:

Public Member Functions

delegate string GetAutoAssetPathAndNameDelegate (SpeechLine speechLine, string language, bool forLipSync)
void ShowGUI (Rect position)
void CacheDisplayLines ()
void ClearLanguages ()
string[] GetLanguageNameArray ()
void LocateLine (SpeechLine speechLine)
void PopulateList (bool currentSceneOnly=false)
void GatherAllAssets ()
void ClearAllAssets ()
bool UpdateOriginalText (SpeechLine speechLine, string updatedText)
ActionListAsset[] GetAllActionListAssets ()
 Gets all ActionList assets referenced by scenes, Managers and other asset files in the project.
SpeechTag GetSpeechTag (int ID)
 Gets a defined SpeechTag.
void ConvertLocalVariableToGlobal (GVar variable, int newGlobalID)
 Converts the Speech Managers's references from a given local variable to a given global variable.
void ConvertGlobalVariableToLocal (GVar variable, string sceneName)
 Converts the Speech Managers's references from a given global variable to a given local variable.
string GetLineFilename (int _lineID, string speakerName="")
 Gets the audio filename of a SpeechLine.
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.
SpeechLine GetLine (int _lineID)
 Gets a SpeechLine class, as generated by the Speech Manager.
bool UseFileBasedLipSyncing ()
 Checks if the current lipsyncing method relies on external text files for each line.
bool IsTextTypeTranslatable (AC_TextType textType)
 Checks if a text type is able to be translated (and will be included in the 'gather text' process)
bool LipSyncingIsAudioBased ()
void Upgrade ()

Public Attributes

bool scrollSubtitles = true
bool scrollNarration = false
float textScrollSpeed = 50
AudioClip textScrollCLip = null
AudioClip narrationTextScrollCLip = null
bool playScrollAudioEveryCharacter = true
SpeechScrollAudioSource speechScrollAudioSource = SpeechScrollAudioSource.SFX
float waitTimeOffset = 0f
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
IfSkipWhileScrolling ifSkipWhileScrolling = IfSkipWhileScrolling.DisplayFullText
bool scrollingTextFactorsLength = false
bool syncSubtitlesToAudio = false
bool useAssetBundles = false
bool searchAudioFiles = true
bool autoNameSpeechFiles = true
ReferenceSpeechFiles referenceSpeechFiles = ReferenceSpeechFiles.ByDirectReference
string autoSpeechFolder = "Speech"
string autoLipsyncFolder = "Lipsync"
string speechAddressablesPrefix = ""
string lipSyncAddressablesPrefix = ""
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< LanguageLanguages = new List<Language> ()
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
AC_TextTypeFlags translatableTextTypes = (AC_TextTypeFlags) ~0
int maxID = -1
SpeechIDRecycling speechIDRecycling = SpeechIDRecycling.NeverRecycle
int activeLineID = -1
bool mergeMatchingSpeechIDs = false
bool useSpeechTags = false
List< SpeechTagspeechTags = new List<SpeechTag>()
string previewMenuName
MergeMatchingIDs mergeMatchingIDs = MergeMatchingIDs.NoMerging

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

◆ GetLanguageNameArray()

string[] AC.SpeechManager.GetLanguageNameArray ( )

Gets an array of all define language names

◆ 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

◆ IsTextTypeTranslatable()

bool AC.SpeechManager.IsTextTypeTranslatable ( AC_TextType textType)

Checks if a text type is able to be translated (and will be included in the 'gather text' process)

Parameters
textTypeThe text type to check
Returns
True if the text type is able to be translated<returns>

◆ LipSyncingIsAudioBased()

bool AC.SpeechManager.LipSyncingIsAudioBased ( )

Checks if the method of animating character speech is based on the audio associated with the speech line.

◆ ShowGUI()

void AC.SpeechManager.ShowGUI ( Rect position)

Shows the GUI.

◆ Upgrade()

void AC.SpeechManager.Upgrade ( )

Updates the Speech Manager from previous AC versions

◆ 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 referenceSpeechFiles = ReferenceSpeechFiles.ByNamingConvention

◆ autoNameSpeechFiles

bool AC.SpeechManager.autoNameSpeechFiles = true

Deprecated - use referenceSpeechFiles instead

◆ autoSpeechFolder

string AC.SpeechManager.autoSpeechFolder = "Speech"

The subdirectory within Resources that speech files are pulled from, if referenceSpeechFiles = ReferenceSpeechFiles.ByNamingConvention

◆ 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

Deprecated

◆ 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

◆ ifSkipWhileScrolling

IfSkipWhileScrolling AC.SpeechManager.ifSkipWhileScrolling = IfSkipWhileScrolling.DisplayFullText

What action to take if the user attempts to skip speech while it it still scrolling

◆ 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

◆ Languages

List<Language> AC.SpeechManager.Languages = new List<Language> ()

A list of all languages defined in the game.

◆ lines

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

All SpeechLines generated to store translations and audio filename references

◆ lipSyncAddressablesPrefix

string AC.SpeechManager.lipSyncAddressablesPrefix = ""

A prefix to attach to any lipsync file's Addressable name

◆ lipSyncMode

LipSyncMode AC.SpeechManager.lipSyncMode = LipSyncMode.Off

The game's lip-syncing method (Off, FromSpeechText, ReadPamelaFile, ReadSapiFile, ReadPapagayoFile, 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

Deprecated - use mergeMatchingIDs instead

◆ 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, 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

◆ previewMenuName

string AC.SpeechManager.previewMenuName

The name of the Menu to display subtitles in when previewing Speech tracks in a Timeline

◆ referenceSpeechFiles

ReferenceSpeechFiles AC.SpeechManager.referenceSpeechFiles = ReferenceSpeechFiles.ByDirectReference

The method by which speech files (audio and lipsync) are referenced

◆ 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

◆ 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,referenceSpeechFiles = ReferenceSpeechFiles.ByNamingConvention, 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

◆ speechAddressablesPrefix

string AC.SpeechManager.speechAddressablesPrefix = ""

A prefix to attach to any speech audio Addressable name

◆ speechIDRecycling

SpeechIDRecycling AC.SpeechManager.speechIDRecycling = SpeechIDRecycling.NeverRecycle

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

◆ speechScrollAudioSource

SpeechScrollAudioSource AC.SpeechManager.speechScrollAudioSource = SpeechScrollAudioSource.SFX

What to play speech-scrolling audio as

◆ speechTags

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

A List of the available SpeechTags

◆ syncSubtitlesToAudio

bool AC.SpeechManager.syncSubtitlesToAudio = false

If True, then subtitles with audio will cease to display once the audio has completed

◆ 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

◆ translatableTextTypes

AC_TextTypeFlags AC.SpeechManager.translatableTextTypes = (AC_TextTypeFlags) ~0

What types of text are able to be translated (and will be included in the 'gather text' process)

◆ 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

Deprecated

◆ 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

◆ waitTimeOffset

float AC.SpeechManager.waitTimeOffset = 0f

The default delay to insert after triggering a line of dialogue with the 'Dialogue: Play speech' Action. A further delay can be added per-Action.