Hi, All!
Simple code:
public class Test : MonoBehaviour
{
LocalizationSettings Instance;
public string GetKeyTitle(KeyCode keyCode)
{
string reference = "F1";//keyCode.ToString();
//print(reference);
var loadAsync = Instance.GetStringDatabase().GetLocalizedStringAsync(reference); //"Keys",
while (!loadAsync.IsDone) continue;
return loadAsync.Result;
}
IEnumerator Start()
{
// Wait for the localization system to initialize, loading Locales, preloading etc.
yield return LocalizationSettings.InitializationOperation;
Instance = LocalizationSettings.InitializationOperation.Result;
print("Ready");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
print("Input.GetKeyDown(KeyCode.F1)");
print(GetKeyTitle(KeyCode.F1));
}
}
}
With errors. Key βF1β exist. Need Helpβ¦