PopAnswerInfo.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. public class PopAnswerInfo : PopBase
  6. {
  7. [SerializeField]
  8. private Game3DButton CloseBtn;
  9. [SerializeField]
  10. private TextMesh AnswerText;
  11. [SerializeField]
  12. private TextMesh DescText;
  13. [SerializeField]
  14. private int DescLineWords = 21;//每一行显示的字数
  15. public override bool NeedBroad { get { return true; } }
  16. protected override void Start()
  17. {
  18. base.Start();
  19. CloseBtn.onClick.AddListener(OnClick);
  20. }
  21. //框体类型
  22. public override PopType MType { get { return PopType.Answer; } }
  23. private QuestionConfig config;
  24. public override void Show(System.Object datas)
  25. {
  26. base.Show(datas);
  27. }
  28. protected override void InitView()
  29. {
  30. base.InitView();
  31. config = GamePlayerData.Instance.eData.mQustionData.GetConfigById(this.CurData.str.Replace("\0", ""));
  32. DescText.text = CStaticMethod.FormatParagraph(config.desc, DescLineWords);
  33. AnswerText.text = config.answer;
  34. }
  35. private void OnClick()
  36. {
  37. if (GamePlayerData.Instance.IsFangzhu())
  38. {
  39. this.Hide();
  40. }
  41. }
  42. private NormalUIData CurData
  43. {
  44. get { return UICanshu as NormalUIData; }
  45. }
  46. }