PC_PranticeResultPanel.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using QFramework;
  4. using System.Collections.Generic;
  5. namespace QFramework
  6. {
  7. public class PC_PranticeResultPanelData : UIPanelData
  8. {
  9. public List<PranticeProcessElement> pranticeProcessElementsData = new List<PranticeProcessElement>();
  10. }
  11. public partial class PC_PranticeResultPanel : UIPanel
  12. {
  13. protected override void ProcessMsg(int eventId, QMsg msg)
  14. {
  15. throw new System.NotImplementedException();
  16. }
  17. protected override void OnInit(IUIData uiData = null)
  18. {
  19. mData = uiData as PC_PranticeResultPanelData ?? new PC_PranticeResultPanelData();
  20. // please add init code here
  21. ConfirmBtn.onClick.AddListener(OnConfirmBtnClick);
  22. }
  23. protected override void OnOpen(IUIData uiData = null)
  24. {
  25. mData = uiData as PC_PranticeResultPanelData ?? new PC_PranticeResultPanelData();
  26. foreach (var element in mData.pranticeProcessElementsData)
  27. {
  28. GameObject tmpObj = Instantiate<GameObject>(Item.gameObject, Content);
  29. PranticeResultItem tmpResultItem = tmpObj.GetComponent<PranticeResultItem>();
  30. tmpObj.SetActive(true);
  31. tmpResultItem.Init(element);
  32. }
  33. }
  34. void Update()
  35. {
  36. if (PranticeManagerForPC.instance.IsFinishUpLoad())
  37. {
  38. ConfirmBtn.GetComponentInChildren<Text>().text = "È·¶¨";
  39. ConfirmBtn.interactable = true;
  40. }
  41. else
  42. {
  43. ConfirmBtn.GetComponentInChildren<Text>().text = "ÕýÔÚÉÏ´«";
  44. ConfirmBtn.interactable = false;
  45. }
  46. }
  47. private void OnConfirmBtnClick()
  48. {
  49. CloseSelf();
  50. }
  51. protected override void OnShow()
  52. {
  53. }
  54. protected override void OnHide()
  55. {
  56. }
  57. protected override void OnClose()
  58. {
  59. }
  60. }
  61. }