ChallengeResultPanel.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using QFramework;
  4. using System;
  5. using System.Collections;
  6. using Org.BouncyCastle.Security.Certificates;
  7. namespace QFramework
  8. {
  9. public class ChallengeResultPanelData : UIPanelData
  10. {
  11. }
  12. public partial class ChallengeResultPanel : UIPanel
  13. {
  14. protected override void ProcessMsg(int eventId, QMsg msg)
  15. {
  16. throw new System.NotImplementedException();
  17. }
  18. protected override void OnInit(IUIData uiData = null)
  19. {
  20. mData = uiData as ChallengeResultPanelData ?? new ChallengeResultPanelData();
  21. // please add init code here
  22. //if (ChallengeManagerForPC.instance.IsFinishUpLoad()) {
  23. ConfirmBtn.onClick.AddListener(OnConfirmBtnClick);
  24. }
  25. void Update()
  26. {
  27. if (ChallengeManagerForPC.instance.IsFinishUpLoad())
  28. {
  29. ConfirmBtn.GetComponentInChildren<Text>().text = "确定";
  30. ConfirmBtn.interactable = true;
  31. }
  32. else
  33. {
  34. ConfirmBtn.GetComponentInChildren<Text>().text = "正在上传";
  35. ConfirmBtn.interactable = false;
  36. }
  37. }
  38. protected override void OnOpen(IUIData uiData = null)
  39. {
  40. int tmpIndex = 1;
  41. foreach (var leveItem in ChallengeManagerForPC.instance.m_LevelItems)
  42. {
  43. GameObject tmpChallResutlObj = Instantiate<GameObject>(Item.gameObject, Content);
  44. tmpChallResutlObj.gameObject.SetActive(true);
  45. ChanllResultItem tmpResultItem = tmpChallResutlObj.GetComponent<ChanllResultItem>();
  46. tmpResultItem.InitData(tmpIndex,leveItem);
  47. tmpIndex ++;
  48. }
  49. UseTime.text = ChallengeManagerForPC.instance.GetChallengeTotalTime();
  50. }
  51. /// <summary>
  52. /// 确认按钮点击
  53. /// </summary>
  54. public void OnConfirmBtnClick()
  55. {
  56. CloseSelf();
  57. // PushHelper.InitBasicData();
  58. //Debug.Log(JsonUtility.ToJson(ChallengeManagerForPC.instance.GetChallengeData()));
  59. // StartCoroutine(PushHelper.SendDataPushRequest(Pushclassification.连续闯关, JsonUtility.ToJson(ChallengeManagerForPC.instance.GetChallengeData()),
  60. // (result, msg) =>
  61. // {
  62. // if (result) Application.Quit();
  63. // else Debug.LogError(msg);
  64. // }));
  65. }
  66. protected override void OnShow()
  67. {
  68. }
  69. protected override void OnHide()
  70. {
  71. }
  72. protected override void OnClose()
  73. {
  74. }
  75. }
  76. }