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

Public Member Functions

void OnAwake ()
 
void LoadAssetBundle (int language)
 Loads in audio and lipsync AssetBundles for a given language More...
 
AudioClip GetSpeechAudioClip (int lineID, Char _speaker)
 Gets the AudioClip associated with a speech line More...
 
GetSpeechLipsyncFile< T > (int lineID, Char _speaker)
 Gets the lipsync file associated with a speech line More...
 
string GetTranslation (string originalText, int _lineID, int language)
 Gets the translation of a line of text. More...
 
string [] GetTranslations (int _lineID)
 Gets all translations of a line of text. More...
 
void UpdateRuntimeTranslation (int lineID, int languageIndex, string translationText)
 Updates the translation of a given line for a given language. More...
 
string GetTranslatableText (ITranslatable translatable, int index=0)
 Gets the text of an ITranslatable instance, based on the game's current language. More...
 
void ImportRuntimeTranslation (TextAsset textAsset, string languageName, int newTextColumn, bool ignoreEmptyCells=false, bool isRTL=false)
 Imports a translation CSV file (as generated by the Speech Manager) into the game - either as a new language, or as an update to an existing one. The first column MUST be the ID number of each line, and the first row must be for the header. More...
 
bool LanguageReadsRightToLeft (int languageIndex)
 Checks if a given language reads right-to-left, Hebrew/Arabic-style More...
 
bool LanguageReadsRightToLeft (string languageName)
 Checks if a given language reads right-to-left, Hebrew/Arabic-style More...
 

Properties

AssetBundle CurrentAudioAssetBundle [get, set]
 
AssetBundle CurrentLipsyncAssetBundle [get, set]
 
List< string > Languages [get]
 

Member Function Documentation

◆ GetSpeechAudioClip()

AudioClip AC.RuntimeLanguages.GetSpeechAudioClip ( int  lineID,
Char  _speaker 
)

Gets the AudioClip associated with a speech line

Parameters
lineIDThe ID number of the speech line, as generated by the Speech Manager
_speakerThe character speaking the line
Returns
Gets the AudioClip associated with a speech line

◆ GetSpeechLipsyncFile< T >()

T AC.RuntimeLanguages.GetSpeechLipsyncFile< T > ( int  lineID,
Char  _speaker 
)

Gets the lipsync file associated with a speech line

Parameters
lineIDThe ID number of the speech line, as generated by the Speech Manager
_speakerThe character speaking the line
Returns
Gets the lipsync file associated with a speech line
Type Constraints
T :Object 

◆ GetTranslatableText()

string AC.RuntimeLanguages.GetTranslatableText ( ITranslatable  translatable,
int  index = 0 
)

Gets the text of an ITranslatable instance, based on the game's current language.

Parameters
translatableThe ITranslatable instance.
indexThe index of the ITranslatable's array of translatable text
Returns
The translatable text.

◆ GetTranslation()

string AC.RuntimeLanguages.GetTranslation ( string  originalText,
int  _lineID,
int  language 
)

Gets the translation of a line of text.

Parameters
originalTextThe line in its original language.
_lineIDThe translation ID number generated by SpeechManager's PopulateList() function
languageThe index number of the language to return the line in, where 0 = the game's original language.
Returns
The translation of the line, if it exists. If a translation does not exist, then the original line will be returned.

◆ GetTranslations()

string [] AC.RuntimeLanguages.GetTranslations ( int  _lineID)

Gets all translations of a line of text.

Parameters
_lineIDThe translation ID number generated by SpeechManager's PopulateList() function
Returns
All translations of the line, if they exist. If a translation does not exist, nothing will be returned.

◆ ImportRuntimeTranslation()

void AC.RuntimeLanguages.ImportRuntimeTranslation ( TextAsset  textAsset,
string  languageName,
int  newTextColumn,
bool  ignoreEmptyCells = false,
bool  isRTL = false 
)

Imports a translation CSV file (as generated by the Speech Manager) into the game - either as a new language, or as an update to an existing one. The first column MUST be the ID number of each line, and the first row must be for the header.

Parameters
textAssetThe CSV file as a text asset.
languageNameThe name of the language. If a language by this name already exists in the system, the import process will update it.
newTextColumnThe column number (starting from zero) that holds the new translation. This must be greater than zero, as the first column should be occupied by the ID numbers.
ignoreEmptyCellsIf True, then empty cells will not be imported and the original language will be used instead
isRTLIf True, the language is read right-to-left

◆ LanguageReadsRightToLeft() [1/2]

bool AC.RuntimeLanguages.LanguageReadsRightToLeft ( int  languageIndex)

Checks if a given language reads right-to-left, Hebrew/Arabic-style

Parameters
languageIndexThe index number of the language to check, where 0 is the game's original language
Returns
True if the given language reads right-to-left

◆ LanguageReadsRightToLeft() [2/2]

bool AC.RuntimeLanguages.LanguageReadsRightToLeft ( string  languageName)

Checks if a given language reads right-to-left, Hebrew/Arabic-style

Parameters
languageNameThe name of the language to check, as written in the Speech Manager
Returns
True if the given language reads right-to-left

◆ LoadAssetBundle()

void AC.RuntimeLanguages.LoadAssetBundle ( int  language)

Loads in audio and lipsync AssetBundles for a given language

Parameters
languageThe index number of the language to load AssetBundles for

◆ UpdateRuntimeTranslation()

void AC.RuntimeLanguages.UpdateRuntimeTranslation ( int  lineID,
int  languageIndex,
string  translationText 
)

Updates the translation of a given line for a given language.

Parameters
lineIDThe ID of the text to update, as generated by the Speech Manager
languageIndexThe index number of the language to update. Must be greater than 0, since 0 is the game's original language
translationTextThe updated translation text

Property Documentation

◆ CurrentAudioAssetBundle

AssetBundle AC.RuntimeLanguages.CurrentAudioAssetBundle
getset

The AssetBundle to retrieve audio files from

◆ CurrentLipsyncAssetBundle

AssetBundle AC.RuntimeLanguages.CurrentLipsyncAssetBundle
getset

The AssetBundle to retrieve lipsync files from

◆ Languages

List<string> AC.RuntimeLanguages.Languages
get

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