using UnityEngine; using UnityEngine.UI; using QFramework; using System; using System.Collections; using Org.BouncyCastle.Security.Certificates; namespace QFramework { public class ChallengeResultPanelData : UIPanelData { } public partial class ChallengeResultPanel : UIPanel { protected override void ProcessMsg(int eventId, QMsg msg) { throw new System.NotImplementedException(); } protected override void OnInit(IUIData uiData = null) { mData = uiData as ChallengeResultPanelData ?? new ChallengeResultPanelData(); // please add init code here //if (ChallengeManagerForPC.instance.IsFinishUpLoad()) { ConfirmBtn.onClick.AddListener(OnConfirmBtnClick); } void Update() { if (ChallengeManagerForPC.instance.IsFinishUpLoad()) { ConfirmBtn.GetComponentInChildren().text = "确定"; ConfirmBtn.interactable = true; } else { ConfirmBtn.GetComponentInChildren().text = "正在上传"; ConfirmBtn.interactable = false; } } protected override void OnOpen(IUIData uiData = null) { int tmpIndex = 1; foreach (var leveItem in ChallengeManagerForPC.instance.m_LevelItems) { GameObject tmpChallResutlObj = Instantiate(Item.gameObject, Content); tmpChallResutlObj.gameObject.SetActive(true); ChanllResultItem tmpResultItem = tmpChallResutlObj.GetComponent(); tmpResultItem.InitData(tmpIndex,leveItem); tmpIndex ++; } UseTime.text = ChallengeManagerForPC.instance.GetChallengeTotalTime(); } /// /// 确认按钮点击 /// public void OnConfirmBtnClick() { CloseSelf(); // PushHelper.InitBasicData(); //Debug.Log(JsonUtility.ToJson(ChallengeManagerForPC.instance.GetChallengeData())); // StartCoroutine(PushHelper.SendDataPushRequest(Pushclassification.连续闯关, JsonUtility.ToJson(ChallengeManagerForPC.instance.GetChallengeData()), // (result, msg) => // { // if (result) Application.Quit(); // else Debug.LogError(msg); // })); } protected override void OnShow() { } protected override void OnHide() { } protected override void OnClose() { } } }