private void Refresh()
 {
     m_lstDifficultyInfo = null;
     // Check File
     if (m_DifficultyControlDataMap == null || m_DifficultyControlDataMap.MapFileData == null)
     {
         return;
     }
     if (m_DifficultyControlDataMap.MapFileData.Count <= 0)
     {
         return;
     }
     // Game Difficulty
     if (!m_DifficultyControlDataMap.MapFileData.ContainsKey(m_GameID))
     {
         m_DifficultyCount     = 0;
         m_DifficultyLastCount = 0;
         return;
     }
     m_DifficultyControlData = m_DifficultyControlDataMap.MapFileData[m_GameID];
     // Difficulty Count
     m_DifficultyCount     = m_DifficultyControlData.DifficultyConfig.Count;
     m_DifficultyLastCount = m_DifficultyCount;
     // Editor Data
     m_lstDifficultyInfo = new List <DifficultyInfo>();
     foreach (string diffName in m_DifficultyControlData.DifficultyConfig.Keys)
     {
         DifficultyInfo temp = new DifficultyInfo();
         temp.Name   = diffName;
         temp.Offset = AdaptiveDifficultyManager.ConvertFloat(m_DifficultyControlData.DifficultyConfig[diffName].DifficultyOffset);
         temp.Range  = AdaptiveDifficultyManager.ConvertFloat(m_DifficultyControlData.DifficultyConfig[diffName].DifficultyRange);
         Dictionary <string, float> effect            = new Dictionary <string, float>();
         DefaultUserTalent          defaultUserTalent = ConfigManager.Instance.GetDefaultUserTalent();
         foreach (string talentName in defaultUserTalent.MapTalent.Keys)
         {
             if (m_DifficultyControlData.DifficultyConfig[diffName].TalentEffect.ContainsKey(talentName))
             {
                 float effectValue = AdaptiveDifficultyManager.ConvertFloat(m_DifficultyControlData.DifficultyConfig[diffName].TalentEffect[talentName]);
                 effect.Add(talentName, effectValue);
             }
             else
             {
                 effect.Add(talentName, 0f);
             }
         }
         temp.TalentEffects = effect;
         // add to list
         m_lstDifficultyInfo.Add(temp);
     }
 }
Пример #2
0
 private void Refresh()
 {
     //Talent Count
     m_UserTalentCount     = m_DefaultUserTalentData.MapTalent.Count;
     m_UserTalentLastCount = m_UserTalentCount;
     //Editor Data
     m_lstUserTalents = new List <UserTalentInfo>();
     foreach (string talentName in m_DefaultUserTalentData.MapTalent.Keys)
     {
         UserTalentInfo temp = new UserTalentInfo();
         temp.TalentName  = talentName;
         temp.TalentValue = AdaptiveDifficultyManager.ConvertFloat(m_DefaultUserTalentData.MapTalent[talentName]);
         m_lstUserTalents.Add(temp);
     }
 }