LoginSignup
3
3

More than 3 years have passed since last update.

UnityでLocalizationした値をScriptから取得する方法

Last updated at Posted at 2020-12-31

現在Preview版のLocalization Packageを使って多言語対応する際に、
スクリプトからローカライズされた値を取得する方法が見つからなかったのでメモです。

async/await版で書きましたが、イベントハンドラに登録する書き方もできると思います。

    var table = await new LocalizedStringTable { TableReference = "stringTable" }.GetTable().Task;
    Debug.Log(table.GetEntry("CHANNEL_NAME").GetLocalizedString());

公式ドキュメントは以下です。
https://docs.unity3d.com/Packages/com.unity.localization@0.9/api/UnityEngine.Localization.LocalizedStringTable.html

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3