private static void EnsureConfigFile() { if (!File.Exists(ConfFilePath)) { KTabFile confFile = new KTabFile(); confFile.NewColumn("Key"); confFile.NewColumn("Value"); confFile.NewColumn("Comment"); foreach (string[] strArr in DefaultConfigs) { int row = confFile.NewRow(); confFile.SetValue <string>(row, "Key", strArr[0]); confFile.SetValue <string>(row, "Value", strArr[1]); confFile.SetValue <string>(row, "Comment", strArr[2]); } confFile.Save(ConfFilePath); Logger.Log("新建CosmosEngine配置文件: {0}", ConfFilePath); AssetDatabase.Refresh(); } ConfFile = KTabFile.LoadFromFile(ConfFilePath); }
/// <summary> /// Set AppVersion of KEngineConfig.txt /// </summary> /// <param name="appVersion"></param> //public static void SaveAppVersion(AppVersion appVersion) //{ // EnsureConfigFile(); // SetConfValue(KEngineDefaultConfigs.AppVersion.ToString(), appVersion.ToString()); // Logger.Log("Save AppVersion to KEngineConfig.txt: {0}", appVersion.ToString()); //} /// <summary> /// Set KEngineConfig.txt file, and reload AppEngine's instance of EngineConfigs, (Editor only) /// </summary> /// <param name="key"></param> /// <param name="value"></param> public static void SetConfValue(string key, string value) { foreach (KTabFile.RowInterator row in ConfFile) { string key2 = row.GetString("Key"); if (key == key2) { ConfFile.SetValue <string>(row.Row, "Value", value); } } ConfFile.Save(ConfFilePath); AppEngine.EnsureConfigTab(true); // reload current appengine instance AssetDatabase.Refresh(); }
public void WriteVersion() { string path = GetBuildVersionTab(); // MakeSureExportPath(VerCtrlInfo.VerFile, EditorUserBuildSettings.activeBuildTarget); KTabFile tabFile = new KTabFile(); tabFile.NewColumn("AssetPath"); tabFile.NewColumn("AssetMD5"); tabFile.NewColumn("AssetDateTime"); tabFile.NewColumn("ChangeCount"); foreach (var node in StoreBuildVersion) { int row = tabFile.NewRow(); tabFile.SetValue(row, "AssetPath", node.Key); tabFile.SetValue(row, "AssetMD5", node.Value.MD5); tabFile.SetValue(row, "AssetDateTime", node.Value.DateTime); tabFile.SetValue(row, "ChangeCount", node.Value.ChangeCount); } tabFile.Save(path); }
private static void EnsureConfigFile() { if (!File.Exists(ConfFilePath)) { KTabFile confFile = new KTabFile(); confFile.NewColumn("Key"); confFile.NewColumn("Value"); confFile.NewColumn("Comment"); foreach (string[] strArr in DefaultConfigs) { int row = confFile.NewRow(); confFile.SetValue<string>(row, "Key", strArr[0]); confFile.SetValue<string>(row, "Value", strArr[1]); confFile.SetValue<string>(row, "Comment", strArr[2]); } confFile.Save(ConfFilePath); Logger.Log("新建CosmosEngine配置文件: {0}", ConfFilePath); AssetDatabase.Refresh(); } ConfFile = KTabFile.LoadFromFile(ConfFilePath); }