Example #1
0
        /// <summary>
        /// 設定されたキーコンフィグデータを取得
        /// </summary>
        /// <returns></returns>
        public KeyConfigSaveData GetKeyConfigData()
        {
            var saveData = new KeyConfigSaveData();

            foreach (var pair in keyConfigDictionary)
            {
                saveData.KeyConfigList.Add(new KeyConfigPair()
                {
                    name = pair.Key, codeList = pair.Value
                });
            }
            return(saveData);
        }
Example #2
0
 /// <summary>
 /// 設定されたキーコンフィグを割り当て
 /// </summary>
 /// <param name="configSaveData"></param>
 public void SetKeyConfigData(KeyConfigSaveData configSaveData)
 {
     if (configSaveData == null)
     {
         return;
     }
     foreach (var pair in configSaveData.KeyConfigList)
     {
         if (!keyConfigDictionary.ContainsKey(pair.name))
         {
             keyConfigDictionary.Add(pair.name, pair.codeList);
             continue;
         }
         keyConfigDictionary[pair.name] = pair.codeList;
     }
 }