12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- public class PopAnswerInfo : PopBase
- {
- [SerializeField]
- private Game3DButton CloseBtn;
- [SerializeField]
- private TextMesh AnswerText;
- [SerializeField]
- private TextMesh DescText;
- [SerializeField]
- private int DescLineWords = 21;//每一行显示的字数
- public override bool NeedBroad { get { return true; } }
- protected override void Start()
- {
- base.Start();
- CloseBtn.onClick.AddListener(OnClick);
- }
- //框体类型
- public override PopType MType { get { return PopType.Answer; } }
- private QuestionConfig config;
- public override void Show(System.Object datas)
- {
- base.Show(datas);
- }
- protected override void InitView()
- {
- base.InitView();
- config = GamePlayerData.Instance.eData.mQustionData.GetConfigById(this.CurData.str.Replace("\0", ""));
- DescText.text = CStaticMethod.FormatParagraph(config.desc, DescLineWords);
- AnswerText.text = config.answer;
- }
- private void OnClick()
- {
- if (GamePlayerData.Instance.IsFangzhu())
- {
- this.Hide();
- }
- }
- private NormalUIData CurData
- {
- get { return UICanshu as NormalUIData; }
- }
- }
|