1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- 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>().text = "确定";
- ConfirmBtn.interactable = true;
- }
- else
- {
- ConfirmBtn.GetComponentInChildren<Text>().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<GameObject>(Item.gameObject, Content);
- tmpChallResutlObj.gameObject.SetActive(true);
-
- ChanllResultItem tmpResultItem = tmpChallResutlObj.GetComponent<ChanllResultItem>();
- tmpResultItem.InitData(tmpIndex,leveItem);
- tmpIndex ++;
- }
- UseTime.text = ChallengeManagerForPC.instance.GetChallengeTotalTime();
- }
-
- /// <summary>
- /// 确认按钮点击
- /// </summary>
- 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()
- {
- }
- }
- }
|