コード例 #1
0
ファイル: CTaskView.cs プロジェクト: isoundy000/wzry-1
    public void refresh_Day_HuoYue()
    {
        CTaskModel model = Singleton <CTaskSys> .instance.model;

        this.day_huoyue_txt.text = model.huoyue_data.day_curNum.ToString();
        float x    = (this.day_progress_bg.transform as RectTransform).sizeDelta.x;
        float y    = (this.day_progress.transform as RectTransform).sizeDelta.y;
        uint  num3 = model.huoyue_data.max_dayhuoyue_num;
        float num4 = (((float)model.huoyue_data.day_curNum) / ((float)num3)) * x;

        if (num4 > x)
        {
            num4 = x;
        }
        (this.day_progress.transform as RectTransform).sizeDelta = new Vector2(num4, y);
        for (int i = 0; i < model.huoyue_data.day_huoyue_list.Count; i++)
        {
            ushort            key    = model.huoyue_data.day_huoyue_list[i];
            ResHuoYueDuReward reward = null;
            GameDataMgr.huoyueduDict.TryGetValue(key, out reward);
            if (reward != null)
            {
                GameObject gameObject = this.m_container.gameObject.transform.FindChild(string.Format("box_{0}", reward.wID)).gameObject;
                DebugHelper.Assert(gameObject != null);
                this._show_day_box(gameObject, reward.wID);
            }
        }
    }
コード例 #2
0
ファイル: CTaskView.cs プロジェクト: isoundy000/wzry-1
    private void _init_day_huoyue()
    {
        CTaskModel model = Singleton <CTaskSys> .instance.model;
        uint       num   = model.huoyue_data.max_dayhuoyue_num;
        float      x     = (this.day_progress_bg.transform as RectTransform).sizeDelta.x;
        GameObject obj2  = null;
        int        count = model.huoyue_data.day_huoyue_list.Count;

        for (int i = 0; i < count; i++)
        {
            ushort            key    = model.huoyue_data.day_huoyue_list[i];
            ResHuoYueDuReward reward = null;
            GameDataMgr.huoyueduDict.TryGetValue(key, out reward);
            if (reward != null)
            {
                float num6 = (((float)reward.dwHuoYueDu) / ((float)num)) * x;
                if (num6 > x)
                {
                    num6 = x;
                }
                int element = this.m_container.GetElement();
                obj2 = this.m_container.GetElement(element);
                if (obj2 != null)
                {
                    (obj2.transform as RectTransform).anchoredPosition3D = new Vector3(num6, 0f, 0f);
                    obj2.gameObject.name = string.Format("box_{0}", reward.wID);
                    obj2.transform.Find("icon").GetComponent <CUIEventScript>().m_onDownEventParams.tagUInt = reward.wID;
                }
            }
        }
    }
コード例 #3
0
ファイル: CTaskView.cs プロジェクト: isoundy000/wzry-1
    public void Bind_Week_Node(GameObject node, ushort week_id)
    {
        CTaskModel        model     = Singleton <CTaskSys> .instance.model;
        HuoyueData        data      = model.huoyue_data;
        ResHuoYueDuReward rewardCfg = model.huoyue_data.GetRewardCfg(week_id);

        if (rewardCfg != null)
        {
            Transform transform = node.transform.Find("node/box/icon");
            transform.GetComponent <CUIEventScript>().m_onDownEventParams.tagUInt = week_id;
            node.GetComponent <Text>().text = rewardCfg.dwHuoYueDu.ToString();
            Image component = transform.GetComponent <Image>();
            ResDT_HuoYueDuReward_PeriodInfo info = Singleton <CTaskSys> .instance.model.huoyue_data.IsInTime(rewardCfg);

            if (info != null)
            {
                component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + info.szIcon, this.m_CUIForm, true, false, false);
            }
            else
            {
                component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + rewardCfg.szIcon, this.m_CUIForm, true, false, false);
            }
            bool bActive = data.BAlready_Reward(RES_HUOYUEDU_TYPE.RES_HUOYUEDU_TYPE_WEEK, week_id);
            node.transform.FindChild("node/box/mark").gameObject.CustomSetActive(bActive);
            bool flag2 = !bActive && (data.week_curNum >= rewardCfg.dwHuoYueDu);
            node.transform.FindChild("node/box/effect").gameObject.CustomSetActive(flag2);
            node.transform.FindChild("node/box").GetComponent <Animation>().enabled = flag2;
        }
    }
コード例 #4
0
    private void _init_day_huoyue()
    {
        if (this.bCreateDayNode)
        {
            return;
        }
        CTaskModel model             = Singleton <CTaskSys> .instance.model;
        uint       max_dayhuoyue_num = model.huoyue_data.max_dayhuoyue_num;
        float      x     = (this.day_progress_bg.transform as RectTransform).sizeDelta.x;
        int        count = model.huoyue_data.day_huoyue_list.get_Count();

        for (int i = 0; i < count; i++)
        {
            ushort            key = model.huoyue_data.day_huoyue_list.get_Item(i);
            ResHuoYueDuReward resHuoYueDuReward = null;
            GameDataMgr.huoyueduDict.TryGetValue(key, out resHuoYueDuReward);
            if (resHuoYueDuReward != null)
            {
                float num = resHuoYueDuReward.dwHuoYueDu / max_dayhuoyue_num * x;
                if (num > x)
                {
                    num = x;
                }
                int        element  = this.m_container.GetElement();
                GameObject element2 = this.m_container.GetElement(element);
                if (!(element2 == null))
                {
                    (element2.transform as RectTransform).anchoredPosition3D = new Vector3(num, 0f, 0f);
                    element2.gameObject.name = string.Format("box_{0}", resHuoYueDuReward.wID);
                    element2.transform.Find("icon").GetComponent <CUIEventScript>().m_onDownEventParams.tagUInt = (uint)resHuoYueDuReward.wID;
                }
            }
        }
        this.bCreateDayNode = true;
    }
コード例 #5
0
ファイル: CTaskView.cs プロジェクト: isoundy000/wzry-1
    public void Refresh_Week_Huoyue()
    {
        CTaskModel model = Singleton <CTaskSys> .instance.model;

        this.Bind_Week_Node(this.week_node1, model.huoyue_data.week_reward1);
        this.Bind_Week_Node(this.week_node2, model.huoyue_data.week_reward2);
        this.week_huoyue_text.text = model.huoyue_data.week_curNum.ToString();
    }
コード例 #6
0
ファイル: CTaskView.cs プロジェクト: wujiangu/wanshiwu0.1
    public void OpenForm(CUIEvent uiEvent)
    {
        if (this.m_CUIForm != null)
        {
            this.tablistScript.SelectElement(uiEvent.m_eventParams.tag, true);
        }
        else
        {
            this.m_CUIForm = Singleton <CUIManager> .GetInstance().OpenForm(CTaskSys.TASK_FORM_PATH, true, true);

            this.tablistScript        = this.m_CUIForm.GetWidget(1).GetComponent <CUIListScript>();
            this.tasklistScript_main  = this.m_CUIForm.GetWidget(2).GetComponent <CUIListScript>();
            this.tasklistScript_usual = this.m_CUIForm.GetWidget(3).GetComponent <CUIListScript>();
            this.tasklistScript_mishu = this.m_CUIForm.GetWidget(4).GetComponent <CUIListScript>();
            string[]   strArray = null;
            CTaskModel model    = Singleton <CTaskSys> .instance.model;
            strArray = new string[] { model.Daily_Quest_Career, model.Daily_Quest_NeedGrowing, model.Daily_Quest_NeedMoney, model.Daily_Quest_NeedSeal, model.Daily_Quest_NeedHero };
            this.tablistScript.SetElementAmount(strArray.Length);
            for (int i = 0; i < this.tablistScript.m_elementAmount; i++)
            {
                this.tablistScript.GetElemenet(i).gameObject.transform.FindChild("Text").GetComponent <Text>().text = strArray[i];
            }
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
            this.tablistScript.SelectElement(uiEvent.m_eventParams.tag, true);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
            this.week_huoyue_text = this.m_CUIForm.GetWidget(5).GetComponent <Text>();
            this.week_node1       = this.m_CUIForm.GetWidget(6);
            this.week_node2       = this.m_CUIForm.GetWidget(7);
            this.m_container      = this.m_CUIForm.GetWidget(8).GetComponent <CUIContainerScript>();
            this.day_progress_bg  = this.m_CUIForm.GetWidget(9).GetComponent <Image>();
            this.day_progress     = this.m_CUIForm.GetWidget(10).GetComponent <Image>();
            this.day_huoyue_txt   = this.m_CUIForm.GetWidget(11).GetComponent <Text>();
            this.Refresh_Tab_RedPoint();
            this._init_day_huoyue();
            this.Refresh_Huoyue();
        }
    }
コード例 #7
0
ファイル: CTaskView.cs プロジェクト: isoundy000/wzry-1
    public void OpenForm(CUIEvent uiEvent)
    {
        if (this.m_CUIForm != null)
        {
            this.tablistScript.SelectElement(uiEvent.m_eventParams.tag, true);
        }
        else
        {
            this.m_CUIForm = Singleton <CUIManager> .GetInstance().OpenForm(CTaskSys.TASK_FORM_PATH, true, true);

            this.tablistScript        = this.m_CUIForm.GetWidget(1).GetComponent <CUIListScript>();
            this.tasklistScript_usual = this.m_CUIForm.GetWidget(3).GetComponent <CUIListScript>();
            this.tasklistScript_mishu = this.m_CUIForm.GetWidget(4).GetComponent <CUIListScript>();
            this.m_mainTaskNode       = this.m_CUIForm.transform.Find("node/list_node_main").gameObject;
            this.m_unlockNode         = this.m_CUIForm.transform.Find("node/list_node_main/unlock_node").gameObject;
            this.m_levelRewardNode    = this.m_CUIForm.transform.Find("node/list_node_main/reward_node").gameObject;
            this.m_levelRewardList    = this.m_CUIForm.transform.Find("node/list_node_main/levelList").GetComponent <CUIListScript>();
            this.m_unlockInfoTxt      = this.m_CUIForm.transform.Find("node/list_node_main/unlock_node/Text").GetComponent <Text>();
            this.m_levelRewardText    = this.m_CUIForm.transform.Find("node/list_node_main/reward_node/Text").GetComponent <Text>();
            this.m_normalTaskNode     = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal").gameObject;
            this.m_emptyTaskNode      = this.m_CUIForm.transform.Find("node/list_node_main/task_node/noTask").gameObject;
            this.m_taskNode0          = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/task_0").gameObject;
            this.m_taskNode1          = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/task_1").gameObject;
            this.jumpRewardGameObject = this.m_CUIForm.transform.Find("node/list_node_main/levelList/goto_btn").gameObject;
            DebugHelper.Assert(this.m_mainTaskNode != null, "ctaskview m_mainTaskNode == null");
            DebugHelper.Assert(this.m_unlockNode != null, "ctaskview m_unlockNode == null");
            DebugHelper.Assert(this.m_levelRewardNode != null, "ctaskview m_levelRewardNode == null");
            DebugHelper.Assert(this.m_levelRewardList != null, "ctaskview m_levelRewardList == null");
            DebugHelper.Assert(this.m_unlockInfoTxt != null, "ctaskview m_unlockInfoTxt == null");
            DebugHelper.Assert(this.m_levelRewardText != null, "ctaskview m_levelRewardText == null");
            DebugHelper.Assert(this.m_normalTaskNode != null, "ctaskview m_normalTaskNode == null");
            DebugHelper.Assert(this.m_emptyTaskNode != null, "ctaskview m_emptyTaskNode == null");
            DebugHelper.Assert(this.m_taskNode0 != null, "ctaskview m_taskNode0 == null");
            DebugHelper.Assert(this.m_taskNode1 != null, "ctaskview m_taskNode1 == null");
            DebugHelper.Assert(this.m_taskNode1 != null, "ctaskview jumpRewardGameObject == null");
            string[]   strArray = null;
            CTaskModel model    = Singleton <CTaskSys> .instance.model;
            strArray = new string[] { model.Daily_Quest_Career, model.Daily_Quest_NeedGrowing, model.Daily_Quest_NeedMoney, model.Daily_Quest_NeedSeal, model.Daily_Quest_NeedHero };
            this.tablistScript.SetElementAmount(strArray.Length);
            for (int i = 0; i < this.tablistScript.m_elementAmount; i++)
            {
                this.tablistScript.GetElemenet(i).gameObject.transform.FindChild("Text").GetComponent <Text>().text = strArray[i];
            }
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
            this.tablistScript.SelectElement(uiEvent.m_eventParams.tag, true);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
            this.week_huoyue_text = this.m_CUIForm.GetWidget(5).GetComponent <Text>();
            this.week_node1       = this.m_CUIForm.GetWidget(6);
            this.week_node2       = this.m_CUIForm.GetWidget(7);
            this.m_container      = this.m_CUIForm.GetWidget(8).GetComponent <CUIContainerScript>();
            this.day_progress_bg  = this.m_CUIForm.GetWidget(9).GetComponent <Image>();
            this.day_progress     = this.m_CUIForm.GetWidget(10).GetComponent <Image>();
            this.day_huoyue_txt   = this.m_CUIForm.GetWidget(11).GetComponent <Text>();
            this.Refresh_Tab_RedPoint();
            this._init_day_huoyue();
            this.Refresh_Huoyue();
            CTaskModel model2 = Singleton <CTaskSys> .instance.model;
            if (model2.curLevelRewardData == null)
            {
                uint pvpLevel = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().PvpLevel;

                model2.curLevelRewardData = model2.GetLevelRewardData((int)pvpLevel);
            }
        }
    }