Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    public void WriteManualPath(string path)
    {
        if (path == null)
        {
            return;
        }

        PackageExportConfig.WriteManualPath(path);
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
 public void ReadManualPath()
 {
     PackageExportConfig.ReadManualPath();
 }
Ejemplo n.º 6
0
 public void ReadExportPath()
 {
     PackageExportConfig.ReadExportPath();
 }
Ejemplo n.º 7
0
 public void ReadPublishPath()
 {
     PackageExportConfig.ReadPublishPath();
 }