- Home /
What is the preferred practice when building for three languages?
Hello all,
I have a game that needs to run in three languages. The way each language is represented is by images, text written on an image. My approach is to start the game with main menu, with a button for each language.
When button is pressed for language A - load the scenes associated with language A, but only play the first relevant scene.
If button is pressed for language B - load the scenes associated with language B, but only play the first relevant scene.
if button pressed for language C - load the scenes associated with language C, but only play the first relevant scene.
This looks like a classic case for asset bundle. Can I organize the bundle by scene language and when in run-time load the relevant scenes to the game, but have them play one after another?
Answer by Magso · Apr 23, 2019 at 01:08 PM
Create a script with a language variable and have each UI assign the image to the language using an array.
public int language;
and for each image
using UnityEngine.UI;
Sprite[] setLanguage;
gameObject.GetComponent<Image>().sprite = setLanguage[GetComponent<languageScript>().language];
or if you're using GUITexture
Texture[] setLanguage;
gameObject.GetComponent<GUITexture>().texture = setLanguage[GetComponent<languageScript>().language];