RandomPromoInfo.cs 485 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using System.Collections;
  3. using ICTS.Localization;
  4. using TMPro;
  5. /// <summary>
  6. /// This component is responsible for choosing a random dialog to be displayed before the player starts playing
  7. /// </summary>
  8. public class RandomPromoInfo : ScreenBase
  9. {
  10. public TextMeshProUGUI info;
  11. public string[] infoKeys;
  12. public override void Show()
  13. {
  14. base.Show();
  15. int index = Random.Range(0, infoKeys.Length);
  16. info.text = Localization.instance.Get(infoKeys[index]);
  17. }
  18. }