Adventure Creator Wikia
Register
Advertisement

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 System.Collections;

#if UNITY_EDITOR
using UnityEditor;
#endif
 
 namespace AC
 {
 
     [System.Serializable]
	public class ActionCheckLanguage : ActionCheck
 	{
 
 		// Declare variables here
 		public int currentLanguage;
 
 
 		public ActionCheckLanguage ()
 		{
 			this.isDisplayed = true;
 			category = ActionCategory.Custom;
 			title = "Check Language";
 			description = "Checks which Lenguage is currently set.";
 		}
 
 
 		public override bool CheckCondition ()
 		{
 			if (Options.GetLanguage () == currentLanguage)
 			{
 				return true;
 			}
 			return false;
 		}
 
 
 		#if UNITY_EDITOR
 
 		override public void ShowGUI ()
 		{
 			// Action-specific Inspector GUI code here
 			currentLanguage = EditorGUILayout.IntField ("Current language index:", currentLanguage);
 		}
 
 
 		public override string SetLabel ()
 		{
 			// Return a string used to describe the specific action's job.
 			return ("(" + currentLanguage + ")");
 		}
 
 		#endif
 
 	}
 
 }
Advertisement