wangguan
2020-12-04 06facfa32a388f74c6eba139e1a8fe4700307a6e
Assets/Scripts/UI/FinalPanel/FinalPanel.cs
@@ -68,6 +68,7 @@
    TextMeshProUGUI txt_HScore, txt_Index;
    TextMeshProUGUI rankUpbj;
    GameObject newPlayerImage;//新用户提示
    /// <summary>
    /// 入口函数
    /// </summary>
@@ -129,12 +130,12 @@
        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>();
@@ -148,6 +149,7 @@
        }
        else
        {
            newPlayerImage.SetActive(false);
            StartHttp();
        }
@@ -179,8 +181,6 @@
    bool isSending;
    int sendCount;
    GameObject httpCountDownPanel;
    Button countDownReplayBtn;
    Text countDownTxt;
    private void OpenHttpCountDown(bool isOn)
    {
        if (isOn)
@@ -202,19 +202,13 @@
            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;
            }
        }
@@ -236,11 +230,12 @@
        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();
    }
@@ -310,12 +305,14 @@
    /// <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;
    }
@@ -326,6 +323,10 @@
    protected void TextDoTweenFinish()
    {
        waveText.gameObject.SetActive(true);
        if (_allHttpGetInfoLis == null)
        {
            httpCountDownPanel.SetActive(true);
        }
        if (isNewH)
        {
            image_NewRecord.SetActive(true);
@@ -349,11 +350,7 @@
            }
        }
        // transform.Find("Image1").gameObject.SetActive(false);
        // transform.Find("Image2").gameObject.SetActive(false);
        // transform.Find("Image3").gameObject.SetActive(false);
        endPs?.Play();
        closeBtn.interactable = true;
    }
@@ -429,20 +426,15 @@
        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;