コード例 #1
0
        // Task调用 更新任务
        public void UpdateTheTask(int taskId)
        {
            if (UpdateProcessEvent == null)
            {
                return;
            }
            Task t = m_TaskIdToTask[taskId];

            if (t == null)
            {
                Debug.LogError("错误:找不到任务");
                return;
            }
            if (t.CurExcuteCondtionId == -1)
            {
                return;
            }
            TaskCondition condition = t.TaskConditionList.Find(x => x.Id == t.CurExcuteCondtionId);

            if (condition == null)
            {
                Debug.LogError("错误:找不到任务条件");
                return;
            }
            UpdateProcessEvent(taskId, condition.Id, condition.CurCount);
        }
コード例 #2
0
        public Task(int taskId)
        {
            TaskEntity        = TaskDBModel.Instance.Get(taskId);
            TaskConditionList = new List <TaskCondition>();
            TaskRewardList    = new List <TaskReward>();

            for (int i = 0; i < TaskEntity.GetTaskConditionEntityList().Count; i++)
            {
                TaskCondition condition = new TaskCondition(TaskEntity.GetTaskConditionEntityList()[i].Id);
                TaskConditionList.Add(condition);
            }

            for (int i = 0; i < TaskEntity.GetTaskRewardList().Count; i++)
            {
                TaskReward reward = new TaskReward(TaskEntity.GetTaskRewardList()[i].Id);
                TaskRewardList.Add(reward);
            }
            TaskStatus = TaskStatus.Executory;
        }