public bool SaveXMLConfig() { bool bRet = true; if (IsPackageInfoNull()) { ErrorType = PACKAGE_FAILED_TYPE.PACKAGE_FAILED_UNKNOW_ERROR; return(false); } if (string.IsNullOrEmpty(PackageExportConfig.AssetsConfigPath)) { ErrorType = PACKAGE_FAILED_TYPE.PACKAGE_FAILED_XMLCONFIG_PATH_ERROR; return(false); } if (!IsSubPackageVersionValid()) { ErrorType = PACKAGE_FAILED_TYPE.PACKAGE_FAILED_VERSION_NONE_ERROR; return(false); } PackageExportConfig.CreateXMLConifg(PackageExportConfig.AssetsConfigPath); UniversalEditorUtility.MakeFileWriteable(PackageExportConfig.AssetsConfigPath); XmlDocument docment = new XmlDocument(); XmlElement root = docment.CreateElement("ExportPackageConfig"); docment.AppendChild(root); XmlElement nodeVersion = docment.CreateElement("Version"); UpdatePackageVersion(); nodeVersion.InnerText = m_Assets.PackageInfo.VersionNum; root.AppendChild(nodeVersion); XmlElement nodePath = docment.CreateElement("Path"); root.AppendChild(nodePath); foreach (string sPath in m_Assets.PackageInfo.ExportAssets) { XmlElement node = docment.CreateElement("Item"); node.InnerText = sPath; nodePath.AppendChild(node); } try { docment.Save(PackageExportConfig.AssetsConfigPath); } catch (System.Exception e) { bRet = false; Debug.Log("保存打包工具配置文件失败: " + e.Message); } return(bRet); }
public void WriteManualPath(string path) { if (path == null) { return; } PackageExportConfig.WriteManualPath(path); }
public string UpdateExportPath(string exportPath) { if (exportPath != null) { if (string.IsNullOrEmpty(PackageExportConfig.ExportPath) || (exportPath.CompareTo(PackageExportConfig.ExportPath) != 0)) { if (!(exportPath.EndsWith(@"\") || exportPath.EndsWith("/"))) { exportPath = exportPath + "/"; } PackageExportConfig.WriteExportPath(exportPath); } } return(PackageExportConfig.ExportPath); }
public string UpdateManualPath(string manualPath) { if (!string.IsNullOrEmpty(manualPath)) { if (string.IsNullOrEmpty(PackageExportConfig.ManualPath) || (manualPath.CompareTo(PackageExportConfig.ManualPath) != 0)) { if (!(manualPath.EndsWith(@"\") || manualPath.EndsWith("/"))) { manualPath = manualPath + "/"; } PackageExportConfig.WriteManualPath(manualPath); } } else { PackageExportConfig.WriteManualPath(""); } return(PackageExportConfig.ManualPath); }
public void ReadManualPath() { PackageExportConfig.ReadManualPath(); }
public void ReadExportPath() { PackageExportConfig.ReadExportPath(); }
public void ReadPublishPath() { PackageExportConfig.ReadPublishPath(); }