public static void SaveOldVersionInfo() { string filePath = FileUtil.StreamAssetsPath + "/" + CoreConst.VersionFile; if (!File.Exists(filePath)) { return; } VersionInfo versionInfo = Version.GetInstance().ReadVersionFile(filePath); string historyPath = Application.dataPath.Replace("/Assets", "/VersionHistory"); if (!Directory.Exists(historyPath)) { Directory.CreateDirectory(historyPath); } historyPath += "/" + versionInfo.Target; if (!Directory.Exists(historyPath)) { Directory.CreateDirectory(historyPath); } historyPath += ("/" + versionInfo.AppVersion + "_" + versionInfo.ResVersion + ".ver"); if (File.Exists(historyPath)) { // 如果当前版本记录文件存在 if (EditorUtility.DisplayDialog("版本控制", "当前版本文件已经存在,点击确定覆盖!", "确定", "取消")) { Version.GetInstance().WriteVersion(versionInfo, historyPath); ResToolsWindow curWindow = (ResToolsWindow)EditorWindow.GetWindow(typeof(ResToolsWindow)); curWindow.ShowNotification(new GUIContent("添加成功")); } } else { Version.GetInstance().WriteVersion(versionInfo, historyPath); ResToolsWindow curWindow = (ResToolsWindow)EditorWindow.GetWindow(typeof(ResToolsWindow)); curWindow.ShowNotification(new GUIContent("添加成功")); } }
static void ResPackager() { ResToolsWindow curWindow = (ResToolsWindow)EditorWindow.GetWindow(typeof(ResToolsWindow)); }