Beispiel #1
0
 private void SwitchButton(DailyTaskType type)
 {
     this.mDailyTaskSelect.SetActive(type == DailyTaskType.DAILY);
     this.mFindTaskSelect.SetActive(type == DailyTaskType.FIND);
     this.mLimitTaskSelect.SetActive(type == DailyTaskType.LIMIT);
     this.mBuyType.SetActive(type == DailyTaskType.FIND);
     this.mContent.set_sizeDelta(new Vector2(this.mContent.get_sizeDelta().x, (type != DailyTaskType.FIND) ? 514f : 465f));
     this.RefreshList();
 }
Beispiel #2
0
    private DailyTaskItem CreateItem(DailyTask data, DailyTaskType type)
    {
        DailyTaskItem dailyTaskItem = this.mItems.Find((DailyTaskItem e) => e.get_gameObject().get_name() == "Unused");

        if (dailyTaskItem == null)
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("DailyTaskItem");
            UGUITools.SetParent(this.mItemList.get_gameObject(), instantiate2Prefab, false);
            dailyTaskItem = instantiate2Prefab.GetComponent <DailyTaskItem>();
            this.mItems.Add(dailyTaskItem);
        }
        dailyTaskItem.get_gameObject().SetActive(true);
        dailyTaskItem.get_gameObject().set_name(data.taskId.ToString());
        dailyTaskItem.SetData(data, type, this.mTogGold.get_isOn(), new Action <DailyTaskItem>(this.OnClickButton));
        return(dailyTaskItem);
    }
Beispiel #3
0
 private void OnClickSwitchButton(GameObject go)
 {
     if (go == this.mBtnDailyTask.get_gameObject())
     {
         this.mCurTaskType = DailyTaskType.DAILY;
     }
     else if (go == this.mBtnFindTask.get_gameObject())
     {
         this.mCurTaskType = DailyTaskType.FIND;
     }
     else if (go == this.mBtnLimitTask.get_gameObject())
     {
         this.mCurTaskType = DailyTaskType.LIMIT;
     }
     this.SwitchButton(this.mCurTaskType);
 }
    public void SetData(DailyTask task, DailyTaskType type, bool isGoldBuy, Action <DailyTaskItem> clickCallBack = null)
    {
        this.mTask         = task;
        this.mType         = type;
        this.mEventHandler = clickCallBack;
        this.mDailyData    = DataReader <MeiRiMuBiao> .Get(this.mTask.taskId);

        if (this.mDailyData != null)
        {
            if (this.mFxId > 0)
            {
                FXSpineManager.Instance.DeleteSpine(this.mFxId, true);
                this.mFxId = 0;
            }
            if (this.mDailyData.Retrieve == 1)
            {
                this.mFindData = DataReader <MZhaoHui> .Get(this.mTask.taskId);
            }
            ResourceManager.SetSprite(this.mIcon, GameDataUtils.GetIcon(this.mDailyData.iconId));
            this.mTxName.set_text(GameDataUtils.GetChineseContent(this.mDailyData.introduction1, false));
            switch (this.mType)
            {
            case DailyTaskType.DAILY:
                this.SetDailyData(this.mDailyData);
                break;

            case DailyTaskType.FIND:
                this.SetFindData(this.mFindData, isGoldBuy);
                break;

            case DailyTaskType.LIMIT:
                this.SetTimeData(this.mDailyData);
                break;
            }
        }
    }
    public List <DailyTask> SortDailyList(DailyTaskType type)
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            return(null);
        }
        List <List <DailyTask> > list = new List <List <DailyTask> >();

        for (int i = 0; i < 6; i++)
        {
            list.Add(new List <DailyTask>());
        }
        int lv = EntityWorld.Instance.EntSelf.Lv;

        for (int j = 0; j < this.mDailyList.get_Count(); j++)
        {
            MeiRiMuBiao meiRiMuBiao = DataReader <MeiRiMuBiao> .Get(this.mDailyList.get_Item(j).taskId);

            if (meiRiMuBiao != null)
            {
                SystemOpen systemOpen = DataReader <SystemOpen> .Get(meiRiMuBiao.sysId);

                if (systemOpen != null)
                {
                    switch (type)
                    {
                    case DailyTaskType.DAILY:
                    case DailyTaskType.LIMIT:
                        if (lv < systemOpen.level || (systemOpen.taskId > 0 && !MainTaskManager.Instance.IsFinishedTask(systemOpen.taskId)))
                        {
                            list.get_Item(0).Add(this.mDailyList.get_Item(j));
                        }
                        else if (this.mDailyList.get_Item(j).count == meiRiMuBiao.completeTime)
                        {
                            if ((meiRiMuBiao.buyTime == 1 && this.IsCanBuy(meiRiMuBiao.system)) || meiRiMuBiao.buyTime == 3)
                            {
                                list.get_Item(2).Add(this.mDailyList.get_Item(j));
                            }
                            else
                            {
                                list.get_Item(1).Add(this.mDailyList.get_Item(j));
                            }
                        }
                        else if ((meiRiMuBiao.id == 12030 || meiRiMuBiao.id == 12040 || meiRiMuBiao.id == 12050) && !GuildManager.Instance.IsJoinInGuild())
                        {
                            list.get_Item(0).Add(this.mDailyList.get_Item(j));
                        }
                        else if (this.mDailyList.get_Item(j).count < meiRiMuBiao.completeTime)
                        {
                            list.get_Item(3).Add(this.mDailyList.get_Item(j));
                        }
                        break;

                    case DailyTaskType.FIND:
                        if (this.mDailyList.get_Item(j).canFindTimes == 0)
                        {
                            list.get_Item(4).Add(this.mDailyList.get_Item(j));
                        }
                        else if (this.mDailyList.get_Item(j).canFindTimes > 0)
                        {
                            list.get_Item(5).Add(this.mDailyList.get_Item(j));
                        }
                        break;
                    }
                }
                else
                {
                    list.get_Item(5).Add(this.mDailyList.get_Item(j));
                }
            }
        }
        for (int k = 0; k < 6; k++)
        {
            list.get_Item(k).Sort(new Comparison <DailyTask>(this.SortDailyByPoint));
        }
        List <DailyTask> list2 = new List <DailyTask>();

        for (int l = 5; l >= 0; l--)
        {
            for (int m = list.get_Item(l).get_Count() - 1; m >= 0; m--)
            {
                list2.Add(list.get_Item(l).get_Item(m));
            }
        }
        return(list2);
    }