void SaveConfig() { Dictionary <string, SingleField> config = new Dictionary <string, SingleField>(); //保存默认语言 config.Add(LanguageManager.c_defaultLanguageKey, new SingleField(m_defaultLanguage.ToString())); //保存语言列表 List <string> languageList = new List <string>(); foreach (var item in s_languageList) { if (item != "None") { languageList.Add(item); } } config.Add(LanguageManager.c_languageListKey, new SingleField(languageList)); //保存模块列表 List <string> moduleList = new List <string>(); foreach (var item in s_languageKeyDict) { moduleList.Add(item.Key); } config.Add(LanguageManager.c_moduleListKey, new SingleField(moduleList)); ConfigEditorWindow.SaveData(LanguageManager.c_configFileName, config); }
void InitHotUpdateConfig() { Dictionary <string, SingleField> hotUpdateConfig = new Dictionary <string, SingleField>(); hotUpdateConfig.Add(HotUpdateManager.c_testDownLoadPathKey, new SingleField("")); hotUpdateConfig.Add(HotUpdateManager.c_downLoadPathKey, new SingleField("")); hotUpdateConfig.Add(HotUpdateManager.c_UseTestDownLoadPathKey, new SingleField(false)); ConfigEditorWindow.SaveData(HotUpdateManager.c_HotUpdateConfigName, hotUpdateConfig); }
void SaveConfig() { Dictionary <string, SingleField> data = new Dictionary <string, SingleField>(); SingleField isSecret = new SingleField(true); SingleField publicKey = new SingleField("publickey"); data.Add(EncryptionService.c_isSecretKey, isSecret); data.Add(EncryptionService.c_publickey, publicKey); ConfigEditorWindow.SaveData(EncryptionService.c_EncryptionConfig, data); }
/// <summary> /// 将传入的SchemeData保存到游戏可以读取的地方 /// </summary> /// <param name="schemeData"></param> public static void SaveGameSchemeConfig(SchemeData schemeData) { if (schemeData != null) { Dictionary <string, SingleField> config = new Dictionary <string, SingleField>(); config.Add(SDKManager.c_KeyName, new SingleField(JsonUtility.ToJson(schemeData))); ConfigEditorWindow.SaveData(SDKManager.c_ConfigName, config); } else { File.Delete(ConfigEditorWindow.GetConfigPath(SDKManager.c_ConfigName)); } }
void HotUpdateConfigGUI() { if (!ConfigManager.GetIsExistConfig(HotUpdateManager.c_HotUpdateConfigName)) { if (GUILayout.Button("热更新设置初始化")) { Dictionary <string, SingleField> hotUpdateConfig = new Dictionary <string, SingleField>(); hotUpdateConfig.Add(HotUpdateManager.c_testDownLoadPathKey, new SingleField("")); hotUpdateConfig.Add(HotUpdateManager.c_downLoadPathKey, new SingleField("")); hotUpdateConfig.Add(HotUpdateManager.c_UseTestDownLoadPathKey, new SingleField(false)); ConfigEditorWindow.SaveData(HotUpdateManager.c_HotUpdateConfigName, hotUpdateConfig); } } }
/// <summary> /// 将传入的SchemeData保存到游戏可以读取的地方 /// </summary> /// <param name="schemeData"></param> public static void SaveGameSchemeConfig(SchemeData schemeData) { Debug.Log("SaveGameSchemeConfig " + schemeData.LoginScheme.Count + " " + schemeData.SchemeName); if (schemeData != null) { Dictionary <string, SingleField> config = new Dictionary <string, SingleField>(); config.Add(SDKManager.c_KeyName, new SingleField(JsonUtility.ToJson(schemeData))); ConfigEditorWindow.SaveData(SDKManager.c_ConfigName, config); ConfigManager.CleanCache(); } else { File.Delete(ConfigEditorWindow.GetConfigPath(SDKManager.c_ConfigName)); } }
void SaveLuaConfig() { //Lua库文件 string luaLibConfig = ""; for (int i = 0; i < m_LuaLibFileList.Count; i++) { luaLibConfig += m_LuaLibFileList[i]; if (i != m_LuaLibFileList.Count - 1) { luaLibConfig += "|"; } } //Lua文件 string luaConfig = ""; for (int i = 0; i < m_LuaFileList.Count; i++) { luaConfig += m_LuaFileList[i]; if (i != m_LuaFileList.Count - 1) { luaConfig += "|"; } } if (!m_luaConfig.ContainsKey(LuaManager.c_LuaListKey)) { m_luaConfig.Add(LuaManager.c_LuaListKey, new SingleField(luaConfig)); } else { m_luaConfig[LuaManager.c_LuaListKey].m_content = luaConfig; } if (!m_luaConfig.ContainsKey(LuaManager.c_LuaLibraryListKey)) { m_luaConfig.Add(LuaManager.c_LuaLibraryListKey, new SingleField(luaLibConfig)); } else { m_luaConfig[LuaManager.c_LuaLibraryListKey].m_content = luaLibConfig; } ConfigEditorWindow.SaveData(LuaManager.c_LuaConfigName, m_luaConfig); }
void GetAllConfigName() { EditorGUI.indentLevel = 0; isConfigFold = EditorGUILayout.Foldout(isConfigFold, "新增方案"); if (isConfigFold) { EditorGUI.indentLevel = 1; configName = EditorGUILayout.TextField("方案名", configName); if (!IsExitsSchemeName(configName) && configName != "") { EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("新增", GUILayout.Width(position.width - 60))) { Dictionary <string, SingleField> dict = new Dictionary <string, SingleField>(); ConfigEditorWindow.SaveData(configName, dict); //LoadConfig(configName); configName = ""; } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); } else { if (m_configNameList.Contains(configName)) { EditorGUILayout.LabelField("方案名重复"); } } } EditorGUILayout.Space(); }
void SaveSchemeConfig() { SaveCurrentSchemeConfig(); Dictionary <string, object> editConfig = new Dictionary <string, object>(); Dictionary <string, SingleField> config = new Dictionary <string, SingleField>(); List <string> list = new List <string>(); for (int i = 0; i < m_configList.Count; i++) { list.Add(JsonUtility.ToJson(m_configList[i])); } editConfig.Add(s_schemeKey, list); editConfig.Add(s_currentSchemeKey, currentSchemeData.SchemeName); config.Add(SDKManager.c_KeyName, new SingleField(JsonUtility.ToJson(currentSchemeData))); ConfigEditorWindow.SaveEditorConfigData(s_editorConfigName, editConfig); ConfigEditorWindow.SaveData(SDKManager.c_ConfigName, config); UnityEditor.AssetDatabase.Refresh(); }