| | |
| | | TextMeshProUGUI txt_HScore, txt_Index; |
| | | |
| | | TextMeshProUGUI rankUpbj; |
| | | GameObject newPlayerImage;//新用户提示 |
| | | /// <summary> |
| | | /// 入口函数 |
| | | /// </summary> |
| | |
| | | itemThird = transform.Find("ItemPanel/FinalPanelItemThird").GetComponent<FinalPanelItem>(); |
| | | |
| | | httpCountDownPanel = transform.Find("HttpCountDownPanel").gameObject; |
| | | countDownReplayBtn = transform.Find("HttpCountDownPanel/ReplayBtn").GetComponent<Button>(); |
| | | countDownTxt = transform.Find("HttpCountDownPanel/WarningTxt").GetComponent<Text>(); |
| | | httpCountDownPanel.SetActive(false); |
| | | |
| | | rankUpbj = transform.Find("Image_HScore/RankUp").GetComponent<TextMeshProUGUI>(); |
| | | newPlayerImage = transform.Find("Image_HScore/NewPlayer").gameObject; |
| | | rankUpbj.gameObject.SetActive(false); |
| | | |
| | | |
| | | endPs = transform.Find("Effect_UI_JieSuanShengLi/03").GetComponent<ParticleSystem>(); |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | newPlayerImage.SetActive(false); |
| | | StartHttp(); |
| | | } |
| | | |
| | |
| | | bool isSending; |
| | | int sendCount; |
| | | GameObject httpCountDownPanel; |
| | | Button countDownReplayBtn; |
| | | Text countDownTxt; |
| | | private void OpenHttpCountDown(bool isOn) |
| | | { |
| | | if (isOn) |
| | |
| | | yield return new WaitForSeconds(1.0f); |
| | | sendCount++; |
| | | Debug.Log($"等待了{sendCount}秒"); |
| | | if (sendCount == 3) |
| | | { |
| | | if (!httpCountDownPanel.activeSelf) httpCountDownPanel.SetActive(true); |
| | | if (countDownReplayBtn.gameObject.activeSelf) countDownReplayBtn.gameObject.SetActive(false); |
| | | } |
| | | else if (sendCount > 10) |
| | | if (sendCount > 10) |
| | | { |
| | | Debug.Log("等了10秒了,连接失败"); |
| | | isSending = false; |
| | | countDownTxt.text = "等了10秒了,连接失败"; |
| | | if (!countDownReplayBtn.gameObject.activeSelf) countDownReplayBtn.gameObject.SetActive(true); |
| | | if (!httpCountDownPanel.activeSelf) httpCountDownPanel.SetActive(true); |
| | | |
| | | countDownReplayBtn.onClick.AddListener(Close); |
| | | isSending = false; |
| | | |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | RefreshHttpData(allHttpGetInfoLis, myrank, mydataHttpInfo); |
| | | |
| | | if (allHttpGetInfoLis == null) return; |
| | | |
| | | txt_Name.text = mydataHttpInfo.nickname; |
| | | txt_HScore.text = mydataHttpInfo.score.ToString(); |
| | | txt_Wave.text = mydataHttpInfo.waveInfo; |
| | | if (allHttpGetInfoLis != null) |
| | | { |
| | | txt_Name.text = mydataHttpInfo.nickname; |
| | | txt_HScore.text = mydataHttpInfo.score.ToString(); |
| | | txt_Wave.text = mydataHttpInfo.waveInfo; |
| | | } |
| | | |
| | | PlayDoTween(); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | IEnumerator PlayerItemDoTween() |
| | | { |
| | | |
| | | yield return new WaitForEndOfFrame(); |
| | | scrollerCanvasGroup.alpha = 1; |
| | | itemCanvasGroup.alpha = 1; |
| | | if (_data.Count > 0) |
| | | { |
| | | scrollerCanvasGroup.alpha = 1; |
| | | itemCanvasGroup.alpha = 1; |
| | | |
| | | image_HScore.SetActive(true); |
| | | image_HScore.SetActive(true); |
| | | } |
| | | |
| | | yield break; |
| | | } |
| | |
| | | protected void TextDoTweenFinish() |
| | | { |
| | | waveText.gameObject.SetActive(true); |
| | | if (_allHttpGetInfoLis == null) |
| | | { |
| | | httpCountDownPanel.SetActive(true); |
| | | } |
| | | if (isNewH) |
| | | { |
| | | image_NewRecord.SetActive(true); |
| | |
| | | } |
| | | } |
| | | |
| | | // transform.Find("Image1").gameObject.SetActive(false); |
| | | // transform.Find("Image2").gameObject.SetActive(false); |
| | | // transform.Find("Image3").gameObject.SetActive(false); |
| | | endPs?.Play(); |
| | | |
| | | |
| | | closeBtn.interactable = true; |
| | | } |
| | |
| | | return cellView; |
| | | } |
| | | |
| | | List<HttpGetInfo> _allHttpGetInfoLis; |
| | | private void RefreshHttpData(List<HttpGetInfo> allHttpGetInfoLis, int myrank, HttpGetInfo mydataHttpInfo) |
| | | { |
| | | _allHttpGetInfoLis = allHttpGetInfoLis; |
| | | if (allHttpGetInfoLis == null) |
| | | { |
| | | httpCountDownPanel.SetActive(true); |
| | | countDownTxt.text = "获取排行榜失败"; |
| | | countDownReplayBtn.onClick.AddListener(Close); |
| | | //httpCountDownPanel.SetActive(true); |
| | | return; |
| | | } |
| | | |
| | | // if (isSending) |
| | | // { |
| | | // OpenHttpCountDown(false); |
| | | // } |
| | | |
| | | FinalPanelItemData data; |
| | | |