wangguan
2020-11-05 ac7a95d834b4ef2f5904f54bd4173002b6ff52b7
Assets/Scripts/GameAnalytics_SDK/UI/LoginUI.cs
@@ -25,6 +25,9 @@
        transform.Find("Panel/Button").GetComponent<Button>().onClick.AddListener(OnClickLoginBtn);
        transform.Find("Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnClickResetBtn);
        progressSlider = transform.Find("Progress").GetComponent<Slider>();
        progressSlider.value = 0;
        if (Application.platform == RuntimePlatform.Android)
        {
            //GetetDeviceIMEI();//获取安卓手机IMEI
@@ -85,9 +88,11 @@
            AudioSourceManager.Ins.Play(AudioEnum.UI);
            TDAA_SDKManager.Ins.Statistics(2);//埋点
            //StartCoroutine(loginMy());
            StartCoroutine(LoadScene());
        }else{
            StartCoroutine(loginMy());
            //StartCoroutine(LoadScene());
        }
        else
        {
        }
@@ -217,24 +222,26 @@
    IEnumerator LoadScene()
    {
        async = SceneManager.LoadSceneAsync(GameConfig.NextSceneName);
        async.allowSceneActivation = true;
        /*while (!async.isDone)
        //async.allowSceneActivation = true;
        while (!async.isDone)
        {
            if (async.progress < 0.9f)
                progressValue = async.progress;
            {
                Debug.Log(async.progress);
            }
            //progressValue = async.progress;
            else
                progressValue = 1.0f;
            slider.value = progressValue;
            progress.text = (int)(slider.value * 100) + " %";
                Debug.Log("超过0.9,");
            //progressValue = 1.0f;
            //slider.value = progressValue;
            //progress.text = (int)(slider.value * 100) + " %";
            
            if (async.progress >= 0.89)
            {
                Debug.Log("进展时间分别是:" + async.progress + "," + totalTime);
                if( totalTime >= 3.0f )
                    async.allowSceneActivation = true;
                Debug.Log("进展时间分别是:" + async.progress + ",");
                
                progress.text = "按任意键继续";
                //progress.text = "按任意键继续";
                if (Input.anyKeyDown)
                {
                    async.allowSceneActivation = true;
@@ -243,11 +250,11 @@
            }
            //yield return null;
        }*/
        }
        yield return null;
    }
    private Slider progressSlider;
    IEnumerator loginMy()
    {
        int displayProgress = 0;
@@ -256,10 +263,11 @@
        op.allowSceneActivation = false;
        while (op.progress < 0.9f) //此处如果是 <= 0.9f 则会出现死循环所以必须小0.9
        {
            toProgress = (int)op.progress * 100;
            toProgress = (int)(op.progress * 100);
            while (displayProgress < toProgress)
            {
                ++displayProgress;
                progressSlider.value = displayProgress * 0.01f;
                SetLoadingPercentage(displayProgress);
                yield return new WaitForEndOfFrame();//ui渲染完成之后
            }
@@ -268,6 +276,8 @@
        while (displayProgress < toProgress)
        {
            ++displayProgress;
            progressSlider.value = displayProgress * 0.01f;
            SetLoadingPercentage(displayProgress);
            yield return new WaitForEndOfFrame();
        }