Ejemplo n.º 1
0
    private void RefreshTasks(List <CareerTask> dataTasks)
    {
        for (int i = 0; i < this.m_tasks.get_Count(); i++)
        {
            this.m_tasks.get_Item(i).get_gameObject().SetActive(false);
        }
        if (dataTasks == null)
        {
            return;
        }
        for (int j = 0; j < dataTasks.get_Count(); j++)
        {
            this.m_tasks.get_Item(j).get_gameObject().SetActive(true);
            CareerTask    careerTask    = dataTasks.get_Item(j);
            int           taskId        = careerTask.taskId;
            ZhuanZhiRenWu zhuanZhiRenWu = DataReader <ZhuanZhiRenWu> .Get(taskId);

            if (zhuanZhiRenWu == null)
            {
                Debug.LogError("GameData.ZhuanZhiRenWu no exist, id = " + taskId);
            }
            else
            {
                bool flag = careerTask.status == CareerTask.TaskStatus.Finish;
                this.m_tasks.get_Item(j).SetName(zhuanZhiRenWu, careerTask.count, flag);
                this.m_tasks.get_Item(j).SetFinish(flag);
            }
        }
    }
Ejemplo n.º 2
0
    private static int SortCompare(CareerTask task1, CareerTask task2)
    {
        int result = 0;

        if (task1.taskId < task2.taskId)
        {
            result = -1;
        }
        else if (task1.taskId > task2.taskId)
        {
            result = 1;
        }
        return(result);
    }