C# 클래스 LanguageManager, SmartLocalization

상속: MonoBehaviour
파일 보기 프로젝트 열기: NiklasBorglund/SmartLocalization 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
defaultLanguage string
language string

공개 메소드들

메소드 설명
Awake ( ) : void
ChangeLanguage ( string language ) : void

Changes the language and tries to load it.

Clear ( ) : void

Clear this instance and Destroys it

GetAudioClip ( string key ) : AudioClip

Gets the audio clip for the current language, returns null if nothing is found

GetCultureInfo ( string languageName ) : CultureInfo,

Gets the culture info of the specified string languageName = strings like "en", "es", "sv"

GetLocalizedObjectDataBase ( ) : LocalizedObject>.Dictionary

Gets the localized, clean and parsed object data base.

GetPrefab ( string key ) : GameObject

Gets the prefab game object for the current language, returns null if nothing is found

GetSystemLanguage ( ) : string

Gets the system language for this application using Application.systemLanguage If its SystemLanguage.Unknown, a string with the value "Unknown" will be returned

GetTextDataBase ( ) : string>.Dictionary

Returns the entire RAW language database from the loaded language in a Dictionary it contains type keys and everything

GetTextValue ( string key ) : string

Returns a text value in the current language for the key. Returns null if nothing is found.

GetTexture ( string key ) : Texture

Gets the texture for the current language, returns null if nothing is found

IsLanguageSupported ( CultureInfo, cultureInfo ) : bool

Checks if the language is supported by this application

IsLanguageSupported ( string languageName ) : bool

Checks if the language is supported by this application languageName = strings like "en", "es", "sv"

OnDestroy ( ) : void
SetDefaultLanguage ( CultureInfo, languageInfo ) : void

Sets the default language. This language will be loaded in Awake() if it exists By default this is set to = "en"

SetDefaultLanguage ( string languageName ) : void

Sets the default language. This language will be loaded in Awake() if it exists By default this is set to = "en"

addLanguageChangedListener ( ChangeLanguageEventHandler listener ) : void

Adds the language changed listener to ChangeLanguageEventHandler.

removeLanguageChangedListener ( ChangeLanguageEventHandler listener ) : void

Removes the language changed listener from ChangeLanguageEventHandler.

비공개 메소드들

메소드 설명
GetAvailableLanguages ( ) : void

Gets all the available languages.

GetLocalizedObject ( string key ) : LocalizedObject,

Gets the localized object from the localizedObjectDataBase

LoadResources ( ) : void

Loads the language file, language is specified with the language variable

ReadData ( XmlReader reader ) : void

Reads a specific data tag from the xml document.

ReadElements ( XmlReader reader ) : void

Reads the elements from the loaded xmldocument in LoadResources

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

ChangeLanguage() 공개 메소드

Changes the language and tries to load it.
public ChangeLanguage ( string language ) : void
language string /// Language. ///
리턴 void

Clear() 공개 메소드

Clear this instance and Destroys it
public Clear ( ) : void
리턴 void

GetAudioClip() 공개 메소드

Gets the audio clip for the current language, returns null if nothing is found
public GetAudioClip ( string key ) : AudioClip
key string /// Key. ///
리턴 UnityEngine.AudioClip

GetCultureInfo() 공개 메소드

Gets the culture info of the specified string languageName = strings like "en", "es", "sv"
public GetCultureInfo ( string languageName ) : CultureInfo,
languageName string
리턴 CultureInfo,

GetLocalizedObjectDataBase() 공개 메소드

Gets the localized, clean and parsed object data base.
public GetLocalizedObjectDataBase ( ) : LocalizedObject>.Dictionary
리턴 LocalizedObject>.Dictionary

GetPrefab() 공개 메소드

Gets the prefab game object for the current language, returns null if nothing is found
public GetPrefab ( string key ) : GameObject
key string /// Key. ///
리턴 GameObject

GetSystemLanguage() 공개 메소드

Gets the system language for this application using Application.systemLanguage If its SystemLanguage.Unknown, a string with the value "Unknown" will be returned
public GetSystemLanguage ( ) : string
리턴 string

GetTextDataBase() 공개 메소드

Returns the entire RAW language database from the loaded language in a Dictionary it contains type keys and everything
public GetTextDataBase ( ) : string>.Dictionary
리턴 string>.Dictionary

GetTextValue() 공개 메소드

Returns a text value in the current language for the key. Returns null if nothing is found.
public GetTextValue ( string key ) : string
key string /// The Language Key. ///
리턴 string

GetTexture() 공개 메소드

Gets the texture for the current language, returns null if nothing is found
public GetTexture ( string key ) : Texture
key string /// Key. ///
리턴 Texture

IsLanguageSupported() 공개 메소드

Checks if the language is supported by this application
public IsLanguageSupported ( CultureInfo, cultureInfo ) : bool
cultureInfo CultureInfo,
리턴 bool

IsLanguageSupported() 공개 메소드

Checks if the language is supported by this application languageName = strings like "en", "es", "sv"
public IsLanguageSupported ( string languageName ) : bool
languageName string
리턴 bool

OnDestroy() 공개 메소드

public OnDestroy ( ) : void
리턴 void

SetDefaultLanguage() 공개 메소드

Sets the default language. This language will be loaded in Awake() if it exists By default this is set to = "en"
public SetDefaultLanguage ( CultureInfo, languageInfo ) : void
languageInfo CultureInfo,
리턴 void

SetDefaultLanguage() 공개 메소드

Sets the default language. This language will be loaded in Awake() if it exists By default this is set to = "en"
public SetDefaultLanguage ( string languageName ) : void
languageName string /// Language name. ///
리턴 void

addLanguageChangedListener() 공개 메소드

Adds the language changed listener to ChangeLanguageEventHandler.
public addLanguageChangedListener ( ChangeLanguageEventHandler listener ) : void
listener ChangeLanguageEventHandler Language changed listener.
리턴 void

removeLanguageChangedListener() 공개 메소드

Removes the language changed listener from ChangeLanguageEventHandler.
public removeLanguageChangedListener ( ChangeLanguageEventHandler listener ) : void
listener ChangeLanguageEventHandler Language changed listener.
리턴 void

프로퍼티 상세

defaultLanguage 공개적으로 프로퍼티

The default language.
public string defaultLanguage
리턴 string

language 공개적으로 프로퍼티

The language that the system will try and load if LoadResources is called.
public string language
리턴 string