Ejemplo n.º 1
0
    /// <summary>
    /// 用于创建提示不同的提示框
    /// </summary>
    /// <param name="type">使用哪一个提示类型</param>
    /// <param name="AllowCallBack">确定之后的回调</param>
    /// <param name="CancelCallBack">取消之后的回调</param>
    public static IEnumerator PromptUI(ConfirmType type = ConfirmType.Cancel_OK_Btn)
    {
        using (DownLoadPromptUI ui = new DownLoadPromptUI(type))
        {
            bool isAllow = false;
            if (type == ConfirmType.Cancel_OK_Btn)
            {
                ui.AllowCallBack  = () => { isAllow = true; };
                ui.CancelCallBack = () => {
#if !UNITY_EDITOR
                    Application.Quit();
#endif
                };
            }
            else
            {
                ui.CenterAllowCallBack = () => {
#if !UNITY_EDITOR
                    Application.Quit();
#endif
                };
            }

            while (!isAllow)
            {
                yield return(null);
            }
        }
    }
Ejemplo n.º 2
0
    public static IEnumerator DownLoadChannelFail()
    {
        using (DownLoadPromptUI ui = new DownLoadPromptUI(ConfirmType.Single_OK_Btn))
        {
            bool isAllow = false;

#if UNITY_IOS || UNITY_IPHONE
            ui.CenterAllowCallBack = () =>
            {
                isAllow = true;
                XDSDK.ShowNetWordAlert();
                Application.Quit();
            };
            ui.CenterText = "权限设置";
#else
            ui.CenterAllowCallBack = () =>
            {
                isAllow = true;
                Application.Quit();
            };
            ui.CenterText = "离开";
#endif

            ui.Tips = "无法下载资源,请检查您的网络状态及游戏的网络权限设置。若无法解决问题请联系官方人员(官方QQ群549996364)。";

            while (!isAllow)
            {
                yield return(null);
            }
        }
    }
Ejemplo n.º 3
0
    // 单纯的提示UI
    public static IEnumerator PromptUI(string tips)
    {
        using (DownLoadPromptUI ui = new DownLoadPromptUI(ConfirmType.Single_OK_Btn))
        {
            bool isAllow = false;
            ui.CenterAllowCallBack = () => { isAllow = true; };

            ui.Tips = tips;

            while (!isAllow)
            {
                yield return(null);
            }
        }
    }