Hello,
I´m using the Lean Localization Asset (Unity Asset Store - The Best Assets for Game Making) to make multilanguage game.
Using this asset is easy, but how can i choose the language and it stay for different screens ? For better understanding, how can after choose the language it saves and stay the same language when i load other scene ?
Cheers Paulo Melo
you need to either save this setting to the users preference, (which I suggest) or create a singleton object that handles that language selection.
The first way, all you do is load up a preference, see what language it is, and use it.
Thanks !
So, since you suggest use user prefs i will use that.
You said “The first way, all you do is load up a preference, see what language it is, and use it.”
How can i do that ?
I’ve read the docs but it only says that on windows is saved on “x” folder, on web saves on “y” folder, …
I’ve search on google but i didnt know what is the better tutorial…
Since you know that (using playerprefs) better than me, Do you know any internet video toturial witch works ? Can you please send me the link ? so that i can learn ?
I really dont know anything about it, other than it exists… However, just a little testing gave me this…
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.X))
{
int x = PlayerPrefs.GetInt("X");
string y = PlayerPrefs.GetString("Y") ?? "";
Debug.Log(y + " - " + x.ToString());
PlayerPrefs.SetInt("X", x + 1);
PlayerPrefs.SetString("Y", "fr-FR");
PlayerPrefs.Save();
}
}
}