public void buy()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanQueRenPanelScript_hotfix", "buy"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanQueRenPanelScript_hotfix", "buy", null, null);
            return;
        }

        int totalPrice = 0;

        totalPrice = m_medalDuiHuanRewardData.price * m_goods_num;

        if (UserData.medal < totalPrice)
        {
            ToastScript.createToast("徽章不足,无法兑换");
            return;
        }

        if (UserData.vipLevel < m_medalDuiHuanRewardData.vipLevel)
        {
            ToastScript.createToast("贵族等级不足,无法兑换");
            return;
        }

        {
            NetLoading.getInstance().Show();

            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().goods_id = m_medalDuiHuanRewardData.goods_id;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().num      = m_goods_num;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().CallBack = onReceive_BuyGoods;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().OnRequest();
        }
    }
    public void onReceive_QuickRegister(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onReceive_QuickRegister"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onReceive_QuickRegister", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            string uid = jd["uid"].ToString();

            PlayerPrefs.SetString("account", m_inputAccount_register.text);
            PlayerPrefs.SetString("password", m_inputPassword_register.text);

            UserData.uid = uid;

            SceneManager.LoadScene("MainScene");
        }
        else if (code == (int)TLJCommon.Consts.Code.Code_CommonFail)
        {
            var msg = (string)jd["msg"];
            ToastScript.createToast(msg);
        }
        else
        {
            ToastScript.createToast("服务器内部错误");
        }
    }
    void Start()
    {
        OtherData.s_turntablePanelScript = this;

        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TurntablePanelScript_hotfix", "Start"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TurntablePanelScript_hotfix", "Start", null, null);
            return;
        }

        initUI_Image();

        m_ListViewScript = m_listView.GetComponent <ListViewScript>();

        m_button_free.transform.Find("Text").GetComponent <Text>().text     = UserData.myTurntableData.freeCount.ToString();
        m_button_huizhang.transform.Find("Text").GetComponent <Text>().text = UserData.myTurntableData.huizhangCount.ToString();

        m_text_myLuckyValue.text = UserData.myTurntableData.luckyValue.ToString();

        // 获取转盘数据
        {
            NetLoading.getInstance().Show();

            LogicEnginerScript.Instance.GetComponent <GetTurntableRequest>().CallBack = onReceive_GetTurntable;
            LogicEnginerScript.Instance.GetComponent <GetTurntableRequest>().OnRequest();
        }
    }
    // 登录结果回调
    public void GetLoginResult(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("AndroidCallBack_hotfix", "GetLoginResult"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.AndroidCallBack_hotfix", "GetLoginResult", null, data);
            return;
        }

        LogUtil.Log("Unity收到:" + data);
        try
        {
            JsonData jsonData    = JsonMapper.ToObject(data);
            var      openId      = (string)jsonData["code"];
            var      nickname    = (string)jsonData["nickname"];
            var      channelname = (string)jsonData["channelname"];

            JsonData jd = new JsonData();
            jd["tag"]         = Consts.Tag_Third_Login;
            jd["nickname"]    = nickname;
            jd["third_id"]    = openId;
            jd["channelname"] = channelname;

            NetLoading.getInstance().Show();
            LoginServiceSocket.s_instance.sendMessage(jd.ToJson());
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
    }
    // 获取数值表
    public void getNetFile()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("GetNetEntityFile_hotfix", "getNetFile"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.GetNetEntityFile_hotfix", "getNetFile", null, null);
            return;
        }

        Invoke("onInvoke", 6);

        // 恢复初始状态
        {
            for (int i = 0; i < m_fileList.Count; i++)
            {
                m_fileList[i].m_fileGetState = FileInfo.FileGetState.FileGetState_NoStart;
            }
        }

        // 拉取数值表
        {
            NetLoading.getInstance().Show();

            NetConfig.reqNetConfig();
            PropData.getInstance().reqNet();
            ChatData.getInstance().reqNet();
            HuDongData.getInstance().reqNet();
            if (SensitiveWordUtil.WordsDatas == null || SensitiveWordUtil.WordsDatas.Length == 0)
            {
                SensitiveWordUtil.reqNet();
            }
            VipData.reqNet();
        }
    }
    public void onReceive_UseProp(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("PropDetailPanelScript_hotfix", "onReceive_UseProp"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.PropDetailPanelScript_hotfix", "onReceive_UseProp", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("使用成功");

            useProp(m_propInfo.m_id);
            UpdatePropData();
        }
        else
        {
            ToastScript.createToast("使用失败");
        }
    }
    public void onClickDuiHuan(GameObject obj)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Activity_huafeisuipian_Script_hotfix", "onClickDuiHuan"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Activity_huafeisuipian_Script_hotfix", "onClickDuiHuan", null, obj);
            return;
        }

        int duihuan_id = int.Parse(obj.transform.name);

        {
            HuaFeiSuiPianDuiHuanDataContent temp = HuaFeiSuiPianDuiHuanData.getInstance().getDataById(duihuan_id);

            if (GameUtil.getMyPropNumById(temp.material_id) < temp.material_num)
            {
                ToastScript.createToast("碎片不足");

                return;
            }
        }

        NetLoading.getInstance().Show();

        LogicEnginerScript.Instance.GetComponent <HuaFeiSuiPianDuiHuanRequest>().CallBack   = onReceive_HuaFeiSuiPianDuiHuan;
        LogicEnginerScript.Instance.GetComponent <HuaFeiSuiPianDuiHuanRequest>().duihuan_id = duihuan_id;
        LogicEnginerScript.Instance.GetComponent <HuaFeiSuiPianDuiHuanRequest>().OnRequest();
    }
    void Start()
    {
        {
            m_panel_login.transform.localScale    = new Vector3(0, 0, 0);
            m_panel_register.transform.localScale = new Vector3(0, 0, 0);

            //// 出版号
            //m_text_chubanhao.text = PlayerPrefs.GetString("banhao", "");

            if (!OtherData.s_isFromSetToLogin)
            {
                m_healthTipPanel.transform.localScale = new Vector3(1, 1, 1);
            }

            Set3rdLogin();
            setLogonTypeUI();
        }

        NetLoading.getInstance().Show();
        OtherConfigScript.getInstance().reqNet();

        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "Start"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "Start", null, null);
            return;
        }
    }
    // 等获取到服务器配置文件再调用
    public void init()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "init"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "init", null, null);
            return;
        }

        try
        {
            LoginServiceSocket.create();

            NetLoading.getInstance().Show();

            LoginServiceSocket.s_instance.setOnLoginService_Connect(onSocketConnect);
            LoginServiceSocket.s_instance.setOnLoginService_Receive(onSocketReceive);
            LoginServiceSocket.s_instance.setOnLoginService_Close(onSocketClose);
            LoginServiceSocket.s_instance.startConnect();
        }
        catch (Exception ex)
        {
            LogUtil.Log(ex.Message);
        }
    }
    public void onReceive_CheckSecondPSW(string result)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("CheckSecondPSWPanelScript_hotfix", "onReceive_CheckSecondPSW"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.CheckSecondPSWPanelScript_hotfix", "onReceive_CheckSecondPSW", null, result);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(result);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            OtherData.s_hasCheckSecondPSW = true;
            Destroy(gameObject);
        }
        else if (code == (int)TLJCommon.Consts.Code.Code_PasswordError)
        {
            ToastScript.createToast("徽章密码错误");
        }
        else if (code == (int)TLJCommon.Consts.Code.Code_CommonFail)
        {
            ToastScript.createToast("徽章密码错误");
        }
        else
        {
            ToastScript.createToast("服务器内部错误");
        }
    }
    public void netDataDown()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "netDataDown"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "netDataDown", null, null);
            return;
        }

        // 拉取数值表
        {
            NetLoading.getInstance().Show();

            NetConfig.reqNetConfig();
            PropData.getInstance().reqNet();
            ChatData.getInstance().reqNet();
            HuDongData.getInstance().reqNet();
            SensitiveWordUtil.reqNet();
            VipData.reqNet();
        }

        if (OtherData.s_isTest)
        {
            ToastScript.createToast("这是测试包");
        }
        else
        {
            LogUtil.Log("这是正式包");
        }
    }
Example #12
0
    public void onReceive_GetReward(string json)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc(m_hotfix_class, "onReceive_GetReward"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke(m_hotfix_path, "onReceive_GetReward", null, json);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(json);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            string reward = jd["reward"].ToString();
            GameUtil.changeDataWithStr(reward);
            ShowRewardPanelScript.Show(reward, false);

            // UI变化
            {
                int id = (int)jd["id"];

                Button obj = gameObject.transform.Find("Button_" + id).GetComponent <Button>();
                obj.interactable = false;
                obj.transform.Find("Text").GetComponent <Text>().text = "已领取";
            }
        }
        else
        {
            string msg = jd["msg"].ToString();
            ToastScript.createToast(msg);
        }
    }
    //-------------------------------------------------------------------------------------------------------
    public void onSocketConnect(bool result)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onSocketConnect"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onSocketConnect", null, result);
            return;
        }

        NetLoading.getInstance().Close();

        if (result)
        {
            //LogUtil.Log("连接服务器成功");

            NetLoading.getInstance().Close();
            NetErrorPanelScript.getInstance().Close();

            // 检查版本号
            reqCheckVerisionCode();
        }
        else
        {
            //LogUtil.Log("连接服务器失败,尝试重新连接");

            NetErrorPanelScript.getInstance().Show();
            NetErrorPanelScript.getInstance().setOnClickButton(onClickChongLian);
            NetErrorPanelScript.getInstance().setContentText("连接服务器失败,请重新连接");
        }
    }
    // 请求登录
    public void reqLogin()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "reqLogin"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "reqLogin", null, null);
            return;
        }

        if ((m_inputAccount.text.CompareTo("") == 0) || (m_inputPassword.text.CompareTo("") == 0))
        {
            ToastScript.createToast("请输入账号密码");
            return;
        }

        NetLoading.getInstance().Show();

        {
            JsonData data = new JsonData();

            data["tag"]     = TLJCommon.Consts.Tag_Login;
            data["account"] = m_inputAccount.text;
            string md5 = CommonUtil.GetMD5(m_inputPassword.text);
            LogUtil.Log(md5);
            data["password"]     = md5;
            data["passwordtype"] = 1;

            LoginServiceSocket.s_instance.sendMessage(data.ToJson());
        }
    }
    public void onReceive_ChangeHead(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChangeHeadPanelScript_hotfix", "onReceive_ChangeHead"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChangeHeadPanelScript_hotfix", "onReceive_ChangeHead", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd = JsonMapper.ToObject(data);

        int code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            //UserData.head = "Sprites/Head/head_" + m_choiceHead;
            UserData.head = "head_" + m_choiceHead;

            OtherData.s_mainScript.refreshUI();
            OtherData.s_userInfoScript.InitUI();

            ToastScript.createToast("修改成功");
        }
        else
        {
            ToastScript.createToast("服务器出错");
        }
    }
    void OnHotFixLoaded()
    {
        Debug.Log("OnHotFixLoaded");

        /*
         * 保存dll所有的类-函数数据,这样只用调用一次dll就行了,不用每次都要问一下dll是否有xxx类-函数
         * 避免来回调用dll浪费时间
         */
        {
            s_funcList.Clear();
            List <string> funcList =
                (List <string>)s_appdomain.Invoke("HotFix_Project.ClassRegister", "getFuncList", null, null);
            if (funcList != null)
            {
                for (int i = 0; i < funcList.Count; i++)
                {
                    LogUtil.Log("dll包含的类-函数:" + funcList[i]);
                    s_funcList.Add(funcList[i]);
                }
            }
            else
            {
                LogUtil.Log("没有dll可用");
            }
        }

        NetLoading.getInstance().Close();
        PlayerPrefs.SetInt("codeVersion", OtherData.s_loginScript.m_codeVersion);

        OtherData.s_loginScript.onDllGetOver();
    }
    public void onReceive_CheckVerisionCode(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onReceive_CheckVerisionCode"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onReceive_CheckVerisionCode", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            bool isStopServer = (bool)jd["isStopServer"];
            if (isStopServer)
            {
                NetErrorPanelScript.getInstance().Show();
                NetErrorPanelScript.getInstance().setOnClickButton(onServerIsStop);
                NetErrorPanelScript.getInstance().setContentText("服务器正在维护,请稍后登录。");

                return;
            }

            OtherData.s_canRecharge = (bool)jd["canRecharge"];
            OtherData.s_canDebug    = (bool)jd["canDebug"];

            string apkVersion = jd["apkVersion"].ToString();

            if (OtherData.s_apkVersion.CompareTo(apkVersion) < 0)
            {
                NetErrorPanelScript.getInstance().Show();
                NetErrorPanelScript.getInstance().setOnClickButton(onApkVerisionIsLow);
                NetErrorPanelScript.getInstance().setContentText("您的客户端版本过低,请更新到最新版本。");
            }

            //// 代码版本
            //{
            //    m_codeVersion = (int)jd["codeVersion"];

            //    NetLoading.getInstance().Show();
            //    ILRuntimeUtil.getInstance().downDll(OtherData.getWebUrl() + "hotfix/HotFix_Project-" + m_codeVersion + ".dll");
            //}

            {
                string banbao = jd["banhao"].ToString();
                PlayerPrefs.SetString("banhao", banbao);
            }
        }
        else
        {
            NetErrorPanelScript.getInstance().Show();
            NetErrorPanelScript.getInstance().setOnClickButton(reqCheckVerisionCode);
            NetErrorPanelScript.getInstance().setContentText("服务器内部错误");
        }
    }
    public void getOtherConfigOver()
    {
        // 拉取热更dll
        {
            m_codeVersion = OtherConfigScript.getInstance().m_CodeVersion;

            NetLoading.getInstance().Show();
            ILRuntimeUtil.getInstance().downDll(OtherData.getWebUrl() + "hotfix/HotFix_Project-" + m_codeVersion + ".dll");
        }
    }
Example #19
0
        public static void onReceive_CheckVerisionCode(string data)
        {
            LoginScript script = OtherData.s_loginScript;

            NetLoading.getInstance().Close();

            JsonData jd   = JsonMapper.ToObject(data);
            int      code = (int)jd["code"];

            if (code == (int)TLJCommon.Consts.Code.Code_OK)
            {
                bool isStopServer = (bool)jd["isStopServer"];
                if (isStopServer)
                {
                    NetErrorPanelScript.getInstance().Show();
                    NetErrorPanelScript.getInstance().setOnClickButton(onServerIsStop);
                    NetErrorPanelScript.getInstance().setContentText("服务器正在维护,请稍后登录。");

                    return;
                }

                OtherData.s_canRecharge = (bool)jd["canRecharge"];
                OtherData.s_canDebug    = (bool)jd["canDebug"];

                string apkVersion = jd["apkVersion"].ToString();

                if (OtherData.s_apkVersion.CompareTo(apkVersion) < 0)
                {
                    // ios的暂时不做版本检测
                    //if (OtherData.s_channelName.CompareTo("ios") == 0)
                    //{

                    //}
                    // 评测包不做版本检测
                    if (OtherData.s_channelName.CompareTo("javgame_test") == 0)
                    {
                    }
                    else
                    {
                        NetErrorPanelScript.getInstance().Show();
                        NetErrorPanelScript.getInstance().setOnClickButton(onApkVerisionIsLow);
                        NetErrorPanelScript.getInstance().setContentText("您的客户端版本过低,请更新到最新版本。");
                    }
                }

                {
                    string banbao = jd["banhao"].ToString();
                    PlayerPrefs.SetString("banhao", banbao);
                }
            }
            else
            {
                ToastScript.createToast("服务器内部错误");
            }
        }
    public void CloseLoad(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("AndroidCallBack_hotfix", "CloseLoad"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.AndroidCallBack_hotfix", "CloseLoad", null, data);
            return;
        }

        NetLoading.getInstance().Close();
    }
    public void onGetAllNetFile()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onGetAllNetFile"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onGetAllNetFile", null, null);
            return;
        }

        NetLoading.getInstance().Close();
        init();
    }
    // 点击网络断开弹框中的重连按钮
    public void onClickChongLian()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onClickChongLian"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onClickChongLian", null, null);
            return;
        }

        NetLoading.getInstance().Show();
        NetErrorPanelScript.getInstance().Close();
        LoginServiceSocket.s_instance.startConnect();
    }
Example #23
0
    public void onReceive_CompleteTask(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Item_Task_List_Script_hotfix", "onReceive_CompleteTask"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Item_Task_List_Script_hotfix", "onReceive_CompleteTask", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd      = JsonMapper.ToObject(data);
        int      code    = (int)jd["code"];
        int      task_id = (int)jd["task_id"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("领取成功");

            m_parentScript.setTaskOver(task_id);

            if (OtherData.s_mainScript != null)
            {
                OtherData.s_mainScript.checkRedPoint();
            }

            string reward = TaskDataScript.getInstance().getTaskDataById(task_id).reward;

            // 增加奖励
            if (!string.IsNullOrEmpty(reward))
            {
                List <string> list = new List <string>();
                CommonUtil.splitStr(reward, list, ';');

                for (int i = 0; i < list.Count; i++)
                {
                    List <string> tempList = new List <string>();
                    CommonUtil.splitStr(list[i], tempList, ':');

                    GameUtil.changeData(int.Parse(tempList[0]), int.Parse(tempList[1]));
                }

                //ShowRewardPanelScript.create().GetComponent<ShowRewardPanelScript>().setData(TaskDataScript.getInstance().getTaskDataById(task_id).reward);
                ShowRewardPanelScript.Show(reward, false);
            }
        }
        else
        {
            ToastScript.createToast("领取失败");
        }
    }
    public void onDllGetOver()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onDllGetOver"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onDllGetOver", null, null);
            return;
        }

        {
            // 禁止多点触摸
            Input.multiTouchEnabled = false;

            // 永不息屏
            Screen.sleepTimeout = SleepTimeout.NeverSleep;

            OtherData.s_screenSize = new Vector2(Screen.width, Screen.height);

            // 安卓回调
            AndroidCallBack.s_onPauseCallBack  = onPauseCallBack;
            AndroidCallBack.s_onResumeCallBack = onResumeCallBack;
        }

        ToastScript.clear();

        {
            GameUtil.hideGameObject(m_debugLog);

            // 用于打印屏幕日志
            m_debugLogScript = m_debugLog.GetComponent <DebugLogScript>();
        }

        m_inputAccount.text  = PlayerPrefs.GetString("account", "");
        m_inputPassword.text = PlayerPrefs.GetString("password", "");

        Set3rdLogin();
        setLogonTypeUI();

        if (!OtherData.s_isFromSetToLogin)
        {
            m_healthTipPanel.transform.localScale = new Vector3(1, 1, 1);
            showHealth();
        }
        else
        {
            NetLoading.getInstance().Show();

            // 获取数值表
            OtherData.s_getNetEntityFile.getNetFile();
        }
    }
    // 获取转盘数据
    public void onReceive_GetTurntable(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TurntablePanelScript_hotfix", "onReceive_GetTurntable"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TurntablePanelScript_hotfix", "onReceive_GetTurntable", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        TurntableDataScript.getInstance().initJson(data);
        loadReward();
    }
    public void onClickYiJianLingQu()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TuiGuangYouLiPanelScript_hotfix", "onClickYiJianLingQu"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TuiGuangYouLiPanelScript_hotfix", "onClickYiJianLingQu", null, null);
            return;
        }

        NetLoading.getInstance().Show();

        LogicEnginerScript.Instance.GetComponent <OneKeyGetAllTuiGuangRewardRequest>().CallBack = onCallBackOneKeyGetAllTuiGuangReward;
        LogicEnginerScript.Instance.GetComponent <OneKeyGetAllTuiGuangRewardRequest>().OnRequest();
    }
Example #27
0
    public void onReceive_UseHuaFei(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("UseHuaFeiPanelScript_hotfix", "onReceive_UseHuaFei"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.UseHuaFeiPanelScript_hotfix", "onReceive_UseHuaFei", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        // 保存当前充值时间
        {
            string time = CommonUtil.getCurYear() + "-" + CommonUtil.getCurMonth() + "-" + CommonUtil.getCurDay() + " " +
                          CommonUtil.getCurHour() + ":" + CommonUtil.getCurMinute() + ":" + CommonUtil.getCurSecond();

            PlayerPrefs.SetString("beforeChongZhiHuaFeiTime", time);
        }

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("使用成功,请等待充值到账");

            GameUtil.changeData(m_propInfo.m_id, -m_useNum);

            if (BagPanelScript.Instance != null)
            {
                BagPanelScript.Instance.UpdateUI();
            }

            // 保存当前充值时间
            {
                string time = CommonUtil.getCurYear() + "-" + CommonUtil.getCurMonth() + "-" + CommonUtil.getCurDay() + " " +
                              CommonUtil.getCurHour() + ":" + CommonUtil.getCurMinute() + ":" + CommonUtil.getCurSecond();

                PlayerPrefs.SetString("beforeChongZhiHuaFeiTime", time);
            }

            Destroy(gameObject);
            Destroy(GameObject.Find("PropDetailPanel(Clone)"));
        }
        else
        {
            ToastScript.createToast((string)jd["msg"]);
        }
    }
    public void onInvoke()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("GetNetEntityFile_hotfix", "onInvoke"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.GetNetEntityFile_hotfix", "onInvoke", null, null);
            return;
        }

        NetLoading.getInstance().Close();

        NetErrorPanelScript.getInstance().Show();
        NetErrorPanelScript.getInstance().setOnClickButton(onClick_retryGetNetFile);
        NetErrorPanelScript.getInstance().setContentText("获取配置文件超时,请重新获取");
    }
Example #29
0
    public void onReceive_GetMail(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("EmailPanelScript_hotfix", "onReceive_GetMail"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.EmailPanelScript_hotfix", "onReceive_GetMail", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        UserMailData.getInstance().initJson(data);

        loadMail();
    }
    // QQ登录
    public void onClickLogin_qq()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onClickLogin_qq"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onClickLogin_qq", null, null);
            return;
        }

        AudioScript.getAudioScript().playSound_ButtonClick();
        PlatformHelper.Login("AndroidCallBack", "GetLoginResult", "qq");
        NetLoading.getInstance().Show();

        PlayerPrefs.SetInt("DefaultLoginType", (int)OtherData.DefaultLoginType.DefaultLoginType_QQ);
    }