I'm setting up multiple translations for my game. I need to be able to change the font for other languages (since my main font only supports English and I don't wish to change that font) and in certain scenes I will need to swap art assets for different languages. Is there a way to detect what language is selected?
Comments
AC.Options.GetLanguage ()
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace AC
{
[System.Serializable]
public class ActionLanguage : ActionCheck
{
// Declare variables here
public list currentLanguage;
public bool trueOrFalse;
public ActionLanguage ()
{
this.isDisplayed = true;
category = ActionCategory.Custom;
title = "Chek Language";
description = "Checks which Lenguage is currently set.";
}
override public float Run ()
{
if (!isRunning)
{
isRunning = true;
return defaultPauseTime;
}
else
{
isRunning = false;
return 0f;
}
}
#if UNITY_EDITOR
override public void ShowGUI ()
{
// Action-specific Inspector GUI code here
currentLanguage = EditorGUILayout.LabelField ("If current language is:", currentLanguage, AC.Options.GetLanguage(), true);
trueOrFalse = EditorGUILayout.Equals ("Equals:", trueOrFalse);
AfterRunningOption ();
}
public override string SetLabel ()
{
// Return a string used to describe the specific action's job.
if (currentLanguage)
{
return ("(" + currentLanguage.name + " - " + trueOrFalse.ToString()+")");
}
return "";
string labelAdd = "";
return labelAdd;
}
#endif
}
}