public void addPrepareInitNpc(NPCInfo info) { if (!MTBTaskController.Instance.taskCacherData.PrepareInitNpcMap.ContainsKey(info.position)) { MTBTaskController.Instance.taskCacherData.PrepareInitNpcMap.Add(info.position, info); } else { MTBTaskController.Instance.taskCacherData.PrepareInitNpcMap[info.position] = info; } taskCacheData data = MTBTaskCacheDataLoader.loadData(); data.PrepareInitNpcMap = PrepareInitNpcMap; MTBTaskCacheDataLoader.saveData(data); }
public bool finishStep(int taskId, int stepId) { if (taskId == 0 || stepId == 0) { return(false); } if (canConductTaskList.ContainsKey(taskId)) { taskCacheData data = MTBTaskCacheDataLoader.loadData(); data.canConductTaskList = canConductTaskList; data.taskId = taskId; data.stepId = stepId + 1; MTBTaskCacheDataLoader.saveData(data); return(true); } return(false); }
/*** * 附带刷每个任务接取npc * ***/ private void checkAndInitTask(int taskId) { if (taskId == 0) { return; } if (!canConductTaskList.ContainsKey(taskId)) { canConductTaskList.Add(taskId, MTBTaskDataManager.Instance.getData(taskId)); } taskCacheData data = MTBTaskCacheDataLoader.loadData(); data.canConductTaskList = canConductTaskList; data.taskId = taskId; data.stepId = 0; MTBTaskCacheDataLoader.saveData(data); HasActionObjectManager.Instance.npcManager.InitNPC(taskId, 1); }