Пример #1
0
    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);
        }
    }
Пример #2
0
    private void OnMissionComplete(MissionElement elem)
    {
        MainMissionConfig config = ConfigManager.Instance.GetMainMissionConfig(elem.GetCurrentMissionId());

        if (config != null && config.NextMissionId != 0)
        {
            TryAcceptMission(config.NextMissionId);
        }

        for (int i = 0; i < m_RemovingStore.Count; ++i)
        {
            if (m_RemovingStore[i] == elem.GetCurrentMissionId())
            {
                return;
            }
        }
        m_RemovingStore.Add(elem.GetCurrentMissionId());

        for (int i = 0; i < m_MissionInfoList.Count; ++i)
        {
            if (m_MissionInfoList[i].MissionId == elem.GetCurrentMissionId())
            {
                m_MissionInfoList.RemoveAt(i);
                break;
            }
        }
        RewriteMissionCounter();
        elem = null;
    }
Пример #3
0
    public MainMissionConfig GetMainMissionConfig(int id)
    {
        MainMissionConfigTable config = TryGetConfig <MainMissionConfigTable>(ConfigPath_MainMissionConfig);
        MainMissionConfig      res    = null;

        if (!config.MainMissionConfigMap.TryGetValue(id, out res))
        {
            Debuger.LogWarning("can't find target main mission config " + id);
        }
        return(res);
    }