static void LoadPackageEditorConfig() { Dictionary <string, object> final = ConfigEditorWindow.GetEditorConfigData(BundleConfigEditorWindow.c_configFileName); if (final == null) { Debug.Log(BundleConfigEditorWindow.c_configFileName + " ConfigData dont Exits"); return; } //依赖包 relyPackages = JsonTool.Json2List <EditPackageConfig>((string)final["relyBundles"]); for (int i = 0; i < relyPackages.Count; i++) { //重新加载Object ReLoadGameObject(relyPackages[i]); } //Bundle包 bundles = JsonTool.Json2List <EditPackageConfig>((string)final["AssetsBundles"]); for (int i = 0; i < bundles.Count; i++) { //重新加载Object ReLoadGameObject(bundles[i]); } }
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 LoadSchemeConfig() { m_configList = new List <SchemeData>(); m_configNameList = new List <string>(); Dictionary <string, object> editConfig = ConfigEditorWindow.GetEditorConfigData(s_editorConfigName); if (editConfig != null) { string currentSchemeName = editConfig[s_currentSchemeKey].ToString(); List <object> list = (List <object>)editConfig[s_schemeKey]; for (int i = 0; i < list.Count; i++) { SchemeData tmp = JsonUtility.FromJson <SchemeData>(list[i].ToString()); if (tmp.SchemeName == currentSchemeName) { currentSchemeData = tmp; LoadCurrentSchemeConfig(tmp); } m_configList.Add(tmp); m_configNameList.Add(tmp.SchemeName); } } }
public static Dictionary <string, List <string> > LoadEditorConfig(string c_EditorConfigName, ref List <string> s_languageKeyList) { Dictionary <string, List <string> > s_languageKeyDict = new Dictionary <string, List <string> >(); Dictionary <string, object> config = ConfigEditorWindow.GetEditorConfigData(c_EditorConfigName); if (config == null) { config = new Dictionary <string, object>(); } foreach (var item in config) { List <string> list = new List <string>(); List <object> ObjList = (List <object>)item.Value; for (int i = 0; i < ObjList.Count; i++) { list.Add(ObjList[i].ToString()); s_languageKeyList.Add(item.Key + "/" + ObjList[i].ToString()); } s_languageKeyDict.Add(item.Key, list); } return(s_languageKeyDict); }
public static void SaveData() { LoadData(); Dictionary <string, object> dataTmp = new Dictionary <string, object>(); dataTmp.Add(DataName, JsonTool.Dictionary2Json <UIStyleInfo>(s_StyleData)); ConfigEditorWindow.SaveEditorConfigData(ConfigName, dataTmp); }
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 SaveEditorConfig() { Dictionary <string, object> config = new Dictionary <string, object>(); foreach (var item in s_languageKeyDict) { config.Add(item.Key, item.Value); } ConfigEditorWindow.SaveEditorConfigData(c_EditorConfigName, config); }
public static void SavePackageEditorConfig() { //生成编辑器配置文件 Dictionary <string, object> editorConfig = new Dictionary <string, object>(); editorConfig.Add(BundleConfigEditorWindow.c_keyRelyPackages, JsonTool.List2Json <EditPackageConfig>(relyPackages)); //依赖包 editorConfig.Add(BundleConfigEditorWindow.c_keyBundles, JsonTool.List2Json <EditPackageConfig>(bundles)); //Bundle包 //保存编辑器配置文件 ConfigEditorWindow.SaveEditorConfigData(BundleConfigEditorWindow.c_configFileName, editorConfig); }
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); }
public static void SaveEditorSchemeData() { Dictionary <string, object> editConfig = new Dictionary <string, object>(); List <string> list = new List <string>(); for (int i = 0; i < ConfigList.Count; i++) { list.Add(JsonUtility.ToJson(ConfigList[i])); } editConfig.Add(SDKEditorWindow.s_schemeKey, list); ConfigEditorWindow.SaveEditorConfigData(SDKEditorWindow.s_editorConfigName, editConfig); }
/// <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)); } }
public static void GenerateConfigMetadata() { if (s_configEditorWindow == null) { s_configEditorWindow = EditorWindow.GetWindowWithRect <ConfigEditorWindow>(new Rect(0, 0, 580, 360), true, "Configuration Metadata Editor"); } if (s_configEditorWindow) { s_configEditorWindow.Show(); } }
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); } } }
static void LoadData() { if (s_StyleData == null) { Dictionary <string, object> dataTmp = ConfigEditorWindow.GetEditorConfigData(ConfigName); if (dataTmp != null && dataTmp.ContainsKey(DataName)) { s_StyleData = JsonTool.Json2Dictionary <UIStyleInfo>((string)dataTmp[DataName]); } else { s_StyleData = new Dictionary <string, UIStyleInfo>(); } } }
/// <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); }
/// <summary> ///加载编辑器设置 /// </summary> public static void ReloadEditorSchemeData() { configList = new List <SchemeData>(); configNameList = new List <string>(); configNameList.Add("None"); Dictionary <string, object> editConfig = ConfigEditorWindow.GetEditorConfigData(SDKEditorWindow.s_editorConfigName); if (editConfig != null) { List <object> list = (List <object>)editConfig[SDKEditorWindow.s_schemeKey]; for (int i = 0; i < list.Count; i++) { SchemeData tmp = JsonUtility.FromJson <SchemeData>(list[i].ToString()); configList.Add(tmp); configNameList.Add(tmp.SchemeName); } } }
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(); }
public static void OpenWindow() { ConfigEditorWindow config = EditorWindow.GetWindow <ConfigEditorWindow>(); config.titleContent = new GUIContent("ConfigEditorWindow"); }