PopUpdate.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class PopUpdate : PopBase
  5. {
  6. [SerializeField]
  7. private Game3DButton OkBtn;
  8. [SerializeField]
  9. private TextMesh MText;
  10. [SerializeField]
  11. private TextMesh DescText;//更新描述
  12. private string str_format = "有新版本 {0} 可以使用 \n点击确定开始更新";
  13. protected override void Start()
  14. {
  15. OkBtn.onClick.AddListener(OnClick);
  16. }
  17. //框体类型
  18. public override PopType MType { get { return PopType.Msg; } }
  19. public override void Show(System.Object data)
  20. {
  21. UpdataData mUpdataData = (UpdataData)data;
  22. if(mUpdataData.debug)
  23. {
  24. this.MText.text = string.Format(str_format, mUpdataData.debug_ver);
  25. this.DescText.text = mUpdataData.debug_desc;
  26. }
  27. else
  28. {
  29. this.MText.text = string.Format(str_format, mUpdataData.online_ver);
  30. this.DescText.text = mUpdataData.desc;
  31. }
  32. base.Show();
  33. }
  34. private void OnClick()
  35. {
  36. this.Hide();
  37. MessageCenterController.Instance.Broadcast(GameEnum.MESSAGE_UPDATE_START);
  38. }
  39. }