|
@@ -54,6 +54,24 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //RemoveTaskInfo
|
|
|
|
+ public void RemoveTaskInfo(int taskId)
|
|
|
|
+ {
|
|
|
|
+ TaskInfosDic.Remove(taskId);
|
|
|
|
+ //获取任务配置
|
|
|
|
+ var cfg = TaskCfgArray.Instance.GetCfg(taskId);
|
|
|
|
+ if (cfg == null)
|
|
|
|
+ {
|
|
|
|
+ Log.Error($"出现了没有配置的任务id{taskId}");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var taskType = cfg.taskType;
|
|
|
|
+ TaskType2TaskIdListDic.TryGetValue(taskType, out var taskIds);
|
|
|
|
+ if (taskIds == null) return;
|
|
|
|
+ taskIds.Remove(taskId);
|
|
|
|
+ if (taskIds.Count == 0) TaskType2TaskIdListDic.Remove(taskType);
|
|
|
|
+ }
|
|
|
|
+
|
|
public void UpdateTaskState(int taskId, int state)
|
|
public void UpdateTaskState(int taskId, int state)
|
|
{
|
|
{
|
|
TaskInfosDic.TryGetValue(taskId, out var taskInfo);
|
|
TaskInfosDic.TryGetValue(taskId, out var taskInfo);
|
|
@@ -153,9 +171,9 @@ namespace GFGGame
|
|
return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0], taskCfg.paramsArr[1]);
|
|
return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0], taskCfg.paramsArr[1]);
|
|
case ConstTaskType.FinishStory:
|
|
case ConstTaskType.FinishStory:
|
|
case ConstTaskType.FinishInstanceZones:
|
|
case ConstTaskType.FinishInstanceZones:
|
|
- {
|
|
|
|
- return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0]);
|
|
|
|
- }
|
|
|
|
|
|
+ {
|
|
|
|
+ return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0]);
|
|
|
|
+ }
|
|
default: return string.Format(activeRewardCfg.desc, taskCfg.GetTargetCount());
|
|
default: return string.Format(activeRewardCfg.desc, taskCfg.GetTargetCount());
|
|
}
|
|
}
|
|
}
|
|
}
|