Beispiel #1
0
        public float link_replace_time = 5; //发包间隔
        void ongetPing()
        {
            if (time >= link_notice_time)
            {
                gameObject.SetActive(true);
                net_link.gameObject.SetActive(true);
            }
            else if (time >= link_lose_time)
            {
                //gameObject.SetActive(false);
                net_link.gameObject.SetActive(false);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.DISCONECT);
            }
            else
            {
                //gameObject.SetActive(false);
                net_link.gameObject.SetActive(false);
            }

            GeneralProxy.getInstance().sendGetPing();
            time = time + link_replace_time;
        }
        void refresh()
        {
            var dd = A3_TaskModel.getInstance().GetDailyTask();

            if (dd != null)
            {
                cs_rotine.text = "(" + (A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) - dd.taskCount) + "/" + A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) + ")";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(true);
            }
            else
            {
                //cs_rotine.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(false);
            }

            Variant data      = SvrLevelConfig.instacne.get_level_data(101);
            int     max_times = data["daily_cnt"] + A3_VipModel.getInstance().expFb_count;
            int     use_times = 0;

            if (MapModel.getInstance().dFbDta.ContainsKey(101))
            {
                use_times = Mathf.Min(MapModel.getInstance().dFbDta[101].cycleCount, max_times);
            }
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EXP_DUNGEON))
            {
                cs_expfb.text = "(" + (max_times - use_times) + "/" + max_times + ")";
                this.transform.FindChild("cells/scroll/content/expfb").gameObject.SetActive(true);
            }
            else
            {
                //cs_expfb.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/expfb").gameObject.SetActive(false);
            }

            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.ENTRUST_TASK))
            {
                TaskData entrustTask;
                if ((entrustTask = A3_TaskModel.getInstance().GetEntrustTask()) != null)
                {
                    int curCount, maxCount;
                    maxCount = XMLMgr.instance.GetSXML("task.emis_limit").getInt("emis_limit") * XMLMgr.instance.GetSXML("task.emis_limit").getInt("loop_limit");
                    curCount = maxCount - (entrustTask.taskCount + entrustTask.taskLoop * XMLMgr.instance.GetSXML("task.emis_limit").getInt("emis_limit"));
                    curCount = curCount > 0 ? curCount : 0;
                    this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(true);
                    this.transform.FindChild("cells/scroll/content/entrustTask/name/dj").GetComponent <Text>().text =
                        string.Format("{0}/{1}", curCount, maxCount);
                }
                else
                {
                    this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(false);
                }
            }
            else
            {
                this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(false);
            }

            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.AUTO_PLAY))
            {
                if (GeneralProxy.getInstance().active_open)
                {
                    getTransformByPath("cells/scroll/content/sczghd/go").GetComponent <Button>().interactable = true;
                    this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(true);
                    this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(false);
                    //getTransformByPath("cells/scroll/content/sczghd/go/text").GetComponent<Text>().text = "(已经开启)";
                }
                else
                {
                    this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(false);
                    this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(true);
                    //getTransformByPath("cells/scroll/content/sczghd/go").GetComponent<Button>().interactable = false;
                    //getTransformByPath("cells/scroll/content/sczghd/go/text").GetComponent<Text>().text = "(等待开启)";
                }
            }
            else
            {
                getTransformByPath("cells/scroll/content/sczghd/go").GetComponent <Button>().interactable = false;
                this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(false);
                this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(false);
            }
            cs_sczghd.text = "";
            want_to();
        }