using System; using System.Collections.Generic; using I2.Loc; using UnityEngine; using UnityEngine.UI; public class TextFormatInput : MonoBehaviour { [Serializable] public class FormatInput { public string inputId = string.Empty; public bool negative; public bool isMoveControls; } public string textId = string.Empty; public List formatInputs = new List(); private Text text; private void OnEnable() { if (text == null) { text = GetComponent(); } if ((bool)GetComponent()) { GetComponent().enabled = false; } string[] array = new string[formatInputs.Count]; for (int i = 0; i < array.Length; i++) { array[i] = "" + ((!formatInputs[i].isMoveControls) ? UtilitiesInput.GetActionKeyName(formatInputs[i].inputId, !formatInputs[i].negative) : UtilitiesInput.GetMoveControls()) + ""; } text.text = string.Format(Utilities.GetTranslation(textId), array); } }