CommonInfoDialog.cs 454 B

12345678910111213141516171819
  1. using UnityEngine;
  2. using System.Collections;
  3. using ICTS.Localization;
  4. using TMPro;
  5. public class CommonInfoDialog : ScreenBase
  6. {
  7. public TextMeshProUGUI title, text;
  8. public void SetTitleAndText(string titleKey, string textKey, object[] textParams = null)
  9. {
  10. title.text = Localization.instance.Get(titleKey);
  11. text.text = Localization.instance.Get(textKey);
  12. if (textParams != null)
  13. {
  14. text.text = string.Format(text.text, textParams);
  15. }
  16. }
  17. }