Description: this custom action allows you to verify if an specific language is currently in use.
To use this custom action you have to create a new text file and rename it ActionCheckLanguage.cs then add it to your custom actions folder (which can be setup in the Action manager) or you can drop it in the Actions folder under Adventure Creator/Scripts/Actions.
using UnityEngine;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace AC
{
[System.Serializable]
public class ActionCheckLanguage : ActionCheck
{
public int currentLanguage;
public override ActionCategory Category { get { return ActionCategory.Custom; } }
public override string Title { get { return "Check Language"; } }
public override string Description { get { return "Checks which Lanugage is currently set."; } }
public override bool CheckCondition ()
{
return (Options.GetLanguage () == currentLanguage);
}
#if UNITY_EDITOR
override public void ShowGUI ()
{
currentLanguage = EditorGUILayout.IntField ("Current language index:", currentLanguage);
}
public override string SetLabel ()
{
return ("(" + currentLanguage + ")");
}
#endif
}
}