コード例 #1
0
ファイル: PushEvent.cs プロジェクト: keyking-coin/code
    // Update is called once per frame
    void Update()
    {
        if (pushs.Count == 0)
        {
            return;
        }
        if (!ConfirmUtil.isConfirmShow() && !LoadUtil.isActivity() && !DialogUtil.isPopTips())
        {
            if (!isOpen)
            {
                tryToOpenPush();
            }
        }
        ByteBuffer buffer = MyUtilTools.tryToLogic("DealGrab");

        if (buffer != null)
        {
            DialogUtil.tip("抢单成功", true);
        }
        buffer = MyUtilTools.tryToLogic("DealFavorite");
        if (buffer != null)
        {
            int type = buffer.ReadInt();
            int len  = buffer.ReadInt();
            MainData.instance.user.favorites.Clear();
            for (int i = 0; i < len; i++)
            {
                long value = buffer.ReadLong();
                MainData.instance.user.favorites.Add(value);
            }
            DialogUtil.tip(type == 0 ? "收藏成功" : "取消收藏成功", true);
        }
    }
コード例 #2
0
ファイル: JustRun.cs プロジェクト: keyking-coin/code
    // Update is called once per frame
    void Update()
    {
        if (NetUtil.getInstance.mustLogin && !ConfirmUtil.isConfirmShow() && !LoadUtil.isActivity() && !DialogUtil.isPopTips())
        {
            if (pushEvent != null)
            {
                pushEvent.ignoreAll();
            }
            NetUtil.getInstance.mustLogin = false;
            ConfirmUtil.confirm("你的账号在别处登录了", goToLogin, exit);
            return;
        }
        List <ByteBuffer> modules = NetUtil.getInstance.Module;

        if (modules.Count > 0)
        {
            foreach (ByteBuffer buffer in modules)
            {
                buffer.ReadInt();//成功
                int size = buffer.ReadInt();
                for (int i = 0; i < size; i++)
                {
                    byte code = buffer.ReadByte();
                    if (moduleCalls.ContainsKey(code))
                    {
                        ModuleCallBack call = moduleCalls[code];
                        call(buffer);
                    }
                }
            }
            modules.Clear();
        }
        modules = NetUtil.getInstance.Cachs;
        if (modules.Count > 0)
        {
            modules.Clear();
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (LoadUtil.isActivity())
            {
                return;
            }
            if (ConfirmUtil.isConfirmShow())
            {
                ConfirmUtil.TryToDispear();
                return;
            }
            GameObject photographer = GameObject.Find("photographer");
            if (photographer != null && photographer.activeSelf)
            {
                photographer.GetComponent <PhotographEvent>().over();
                return;
            }
            GameObject popup_select = GameObject.Find("popup-select");
            if (popup_select != null && popup_select.activeSelf)
            {
                popup_select.GetComponent <PopupListEvent>().close();
                return;
            }
            if (DialogUtil.isPopTips())
            {
                DialogUtil.dispear();
                return;
            }
            ConfirmUtil.confirm("是否退出?", exit);
        }
    }