public void InitMissionStep(int missionId, List <int> missionStepList, Action <MissionElement> onMissioinComplete) { m_OnMissioinComplete = onMissioinComplete; m_CurrentMission = ConfigManager.Instance.GetMainMissionConfig(missionId); if (null == m_CurrentMission) { Debuger.LogWarning("can't load mission " + missionId); return; } if (null == missionStepList || missionStepList.Count <= 0) { Debuger.LogWarning("can't load mission step ,mission id : " + missionId); return; } m_CurrentMissionStepList = new List <MissionStepConfig>(missionStepList.Count); for (int i = 0; i < missionStepList.Count; ++i) { int stepId = missionStepList[i]; //try load mission step info MissionStepConfig stepConfig = ConfigManager.Instance.GetMissionStepConfigByStepId(stepId); if (null == stepConfig) { Debuger.LogWarning("Can't load missioni step config ,step id " + stepId); continue; } m_CurrentMissionStepList.Add(stepConfig); } }
public void TriggerSceneState(GameLogicSceneType sceneType) { for (int i = 0; i < m_CurrentMissionStepList.Count; ++i) { MissionStepConfig elemStep = m_CurrentMissionStepList[i]; if (elemStep.SceneId == (int)(sceneType)) { HandleTarget target = HandleTarget.GetHandleTarget(null); if (LimitMethods.HandleLimitExec(target, elemStep.SceneLimitId, null)) { FuncMethods.HandleFuncExec(target, elemStep.SceneFuncId, null); } } HandleTarget target1 = HandleTarget.GetHandleTarget(null); if (LimitMethods.HandleLimitExec(target1, elemStep.CompleteLimitId, null)) { FuncMethods.HandleFuncExec(target1, elemStep.CompleteFuncId, null); } } bool isMissionComplete = false; HandleTarget target2 = HandleTarget.GetHandleTarget(null); if (LimitMethods.HandleLimitExec(target2, m_CurrentMission.CompleteLimitId, null)) { isMissionComplete = true; FuncMethods.HandleFuncExec(target2, m_CurrentMission.CompleteFuncId, null); } if (isMissionComplete) { m_OnMissioinComplete(this); } }
public MissionStepConfig GetMissionStepConfigByStepId(int id) { MissionStepConfigTable config = TryGetConfig <MissionStepConfigTable>(ConfigPath_MissionStepConfig); MissionStepConfig res = null; if (!config.MissionStepByStepIdConfigMap.TryGetValue(id, out res)) { Debuger.LogWarning("can't find target mission step config " + id); } return(res); }