private void SaveFile()
 {
     //Convert Data
     m_DefaultUserTalentData = new DefaultUserTalent();
     m_DefaultUserTalentData.MapTalent = new Dictionary<string, int>();
     for (int i = 0; i < m_UserTalentCount; i++)
     {
         string name = m_lstUserTalents[i].TalentName;
         int value = AdaptiveDifficultyManager.ConvertInt(m_lstUserTalents[i].TalentValue);
         m_DefaultUserTalentData.MapTalent.Add(name, value);
     }
     //Save File
     EditorUtility.DisplayDialog("保存成功", "保存成功", "确定");
     ADE_Helper.SaveDefaultUserTalentMap(m_DefaultUserTalentData);
 }
    private void LoadFile()
    {
        //ADE data
        m_DefaultUserTalentData = ADE_Helper.GetDefaultUserTalentMap();
        if (m_DefaultUserTalentData == null || m_DefaultUserTalentData.MapTalent == null)
        {
            return;
        }
        Refresh();

    }
Пример #3
0
 //Save Data
 public static void SaveDefaultUserTalentMap(DefaultUserTalent fileDataMap)
 {
     byte[] data = ThriftSerialize.Serialize(fileDataMap);
     FileUtils.WriteByteFile(GetDefaultUserTalentDataPath(), data);
 }
Пример #4
0
 //Load Data
 public static DefaultUserTalent GetDefaultUserTalentMap()
 {
     DefaultUserTalent fileDataMap = new DefaultUserTalent();
     ResourceManager.DecodePersonalDataTemplate(GetDefaultUserTalentDataPath(), ref fileDataMap);
     return fileDataMap;
 }
Пример #5
0
    //Merge Data
    public static void MergeDefaultUserTalentMap(ref DefaultUserTalent fileDataMap)
    {
        if (fileDataMap == null || fileDataMap.MapTalent == null)
        {
            fileDataMap = new DefaultUserTalent();
            fileDataMap.MapTalent = new Dictionary<string, int>();
        }
        DefaultUserTalent remoteDataMap = ConfigManager.Instance.GetDefaultUserTalent();
        Dictionary<string, int> remote = remoteDataMap.MapTalent;
        Dictionary<string, int> local = fileDataMap.MapTalent;
        foreach (string name in remote.Keys)
        {
            if (local.ContainsKey(name))
            {

            }
            else
            {
                local.Add(name, remote[name]);
            }
        }
    }
Пример #6
0
 //Sycn Data
 public static void SycnDefaultUserTalentMap(ref DefaultUserTalent fileDataMap)
 {
     if (fileDataMap == null || fileDataMap.MapTalent == null)
     {
         fileDataMap = new DefaultUserTalent();
         fileDataMap.MapTalent = new Dictionary<string, int>();
     }
     DefaultUserTalent remoteDataMap = ConfigManager.Instance.GetDefaultUserTalent();
     Dictionary<string, int> remoteData = remoteDataMap.MapTalent;
     Dictionary<string, int> localData = fileDataMap.MapTalent;
     foreach (string name in remoteData.Keys)
     {
         if (localData.ContainsKey(name))
         {
             localData[name] = remoteData[name];
         }
         else
         {
             localData.Add(name, remoteData[name]);
         }
     }
     Debug.Log("ssasdasd");
 }