static void InitConfigFile() { ToolCommon.CreatePath(SingletonObject <GameConfig> .GetInst().ResourcePath); IOTempConfigFileInfo configFileInfo = new IOTempConfigFileInfo(); IOHelper.SetData(DEFINE.IO_HELPER_TEMP_CONFIG_FILE_INFO, configFileInfo); }
//[DidReloadScripts] public static void OnCompileScripts() { LoadTempFileLog(); IOTempConfigFileInfo configFileInfo = IOHelper.GetData <IOTempConfigFileInfo>(DEFINE.IO_HELPER_TEMP_CONFIG_FILE_INFO); if (configFileInfo == null) { SaveLogToFile(); return; } if (!configFileInfo.bExe) { SaveLogToFile(); return; } Dictionary <string, string> dicPath = new Dictionary <string, string>(); if (configFileInfo.diffFileName.Count != configFileInfo.diffResourceName.Count) { Log("Error: ", "configFileInfo.diffFileName.Count != configFileInfo.diffResourceName.Count"); Debug.LogError("configFileInfo.diffFileName.Count != configFileInfo.diffResourceName.Count"); SaveLogToFile(); return; } for (int i = 0, count = configFileInfo.diffFileName.Count; i < count; i++) { if (!dicPath.ContainsKey(configFileInfo.diffFileName[i])) { dicPath.Add(configFileInfo.diffFileName[i], configFileInfo.diffResourceName[i]); } } Debug.Log(configFileInfo.boundlePath); Debug.Log(configFileInfo.buildTarget); Log("Log2: ", "OnCompileScripts dicPath.Count = " + dicPath.Count); ExecutePath(configFileInfo.boundlePath, configFileInfo.buildTarget, dicPath); Log("Log3: ", "OnCompileScripts dicPath.Count = " + dicPath.Count); //if (dicPath.Count == 0) //{ // InitConfigFile(); // return; //} SaveLogToFile(); }
static void SaveConfigFile(Dictionary <string, string> dicDiffPath, string boundlePath, BuildTarget target) { IOTempConfigFileInfo configFileInfo = IOHelper.GetData <IOTempConfigFileInfo>(DEFINE.IO_HELPER_TEMP_CONFIG_FILE_INFO); if (configFileInfo == null) { Debug.LogError("configFileInfo == null"); } configFileInfo.bExe = true; configFileInfo.buildTarget = target; configFileInfo.boundlePath = boundlePath; configFileInfo.diffFileName.Clear(); configFileInfo.diffResourceName.Clear(); foreach (var pathInfo in dicDiffPath) { configFileInfo.diffFileName.Add(pathInfo.Key); configFileInfo.diffResourceName.Add(pathInfo.Value); } IOHelper.SetData(DEFINE.IO_HELPER_TEMP_CONFIG_FILE_INFO, configFileInfo); }