CommonInfoDialog.cs 533 B

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