Ejemplo n.º 1
0
    public virtual void LoadingAnimation(NetCtrlManager.RequestHandler r, AsyncOperation inAsy, string info)
    {
        OnLoadedEvent = new UnityEvent();

        asy = inAsy;

        if (!isloading)
        {
            isloading = true;
            StartLoading(r, inAsy, info);
        }

        if (receiveInfo != info)
        {
            receiveInfo = info;
//          Debug.Log(info);

            switch (info)
            {
            case "ok":
                displayInfo = "";
                break;

            case "0":
                displayInfo = "正在连接服务";
                break;

            case "1":
                displayInfo = "尝试重新连接";
                break;

            case "2":
                displayInfo = "尝试修复连接";
                break;

            case "3":
                displayInfo = "第4次连接";
                break;

            case "4":
                displayInfo = "第5次连接";
                break;

            case "Request timeout":
                displayInfo = "请求超时,请检查网络";
                DisplayRetry();
                break;

            case "Cannot connect to destination host":
                displayInfo = "无法连接目标主机";
                DisplayRetry();
                break;

            default:
                displayInfo = info;
                DisplayRetry();
                break;
            }
        }
    }
Ejemplo n.º 2
0
    public override void StartLoading(NetCtrlManager.RequestHandler r, AsyncOperation inAsy, string info)
    {
        base.StartLoading(r, inAsy, info);

        if (oneTimeStart)
        {
            oneTimeStart = false;
            canvasGroup.DOFade(1.0f, 0.5f);
        }
        smoothPercent = 0;
    }
Ejemplo n.º 3
0
    public override void StartLoading(NetCtrlManager.RequestHandler r, AsyncOperation inAsy, string info)
    {
        base.StartLoading(r, inAsy, info);

        if (oneTimeStart)
        {
            oneTimeStart = false;
            reTryBtn.onClick.AddListener(r.ManualRetry);
            reTryBtn.onClick.AddListener(HiddenRetry);
            reTryBtnOrginPos = reTryBtn.GetComponent <RectTransform>().localPosition;
            reTryBtn.GetComponent <RectTransform>().anchoredPosition = new Vector2(5000, 0);
            canvasGroup.DOFade(1.0f, 0.5f);
        }

        smoothPercent = 0;
        loadingRing.rectTransform.DORotate(new Vector3(0, 0, -7200), 15.0f, RotateMode.LocalAxisAdd);
    }
Ejemplo n.º 4
0
 public virtual void StartLoading(NetCtrlManager.RequestHandler r, AsyncOperation inAsy, string info)
 {
     request = r;
     Debug.Log(r.name + " StartLoading " + info);
 }
Ejemplo n.º 5
0
        void GetProgress(NetCtrlManager.RequestHandler r, UnityWebRequestAsyncOperation a, string info)
        {
            progress = a.progress;
//          Debug.Log(request.downloadProgress);
        }
Ejemplo n.º 6
0
 public override void LoadingAnimation(NetCtrlManager.RequestHandler r, AsyncOperation inAsy, string info)
 {
     base.LoadingAnimation(r, inAsy, info);
     text.text = displayInfo;
 }