示例#1
0
    public static void MovePFResultXmlToStreamingAssets(BuildTarget bt)
    {
        var tarabpi = BuildBundleManager.GetABSH().GetDataAnalysisXmlMoveTargetABPI();

        if (!Directory.Exists(tarabpi.Dir_Relative))
        {
            Directory.CreateDirectory(tarabpi.Dir_Relative);
        }
        var abpi = BuildBundleManager.GetABSH().GetDataAnalysisXmlABPI();

        if (File.Exists(tarabpi.FullName_RelativePath))
        {
            File.Copy(abpi.FullName_RelativePath, tarabpi.FullName_RelativePath, true);
        }
        else
        {
            File.Copy(abpi.FullName_RelativePath, tarabpi.FullName_RelativePath);
        }
        AssetDatabase.Refresh();
    }
示例#2
0
    public static void InputAllXml()
    {
        var abpi         = BuildBundleManager.GetABSH().GetABUsesABPI();
        var abpi_Outdate = BuildBundleManager.GetABSH().GetABUses_OutdateABPI();

        if (!Directory.Exists(abpi.Dir_Relative))
        {
            Debug.Log(abpi.Dir_Relative + "文件夹不存在");
            return;
        }
        Dictionary <string, List <ABDetailRecord> > tmpRecords = new Dictionary <string, List <ABDetailRecord> >();
        var files = Directory.GetFiles(abpi.Dir_Relative);

        if (files == null || files.Length == 0)
        {
            Debug.Log(abpi.Dir_Relative + "文件夹里没有文件,无法分析");
            return;
        }
        if (!Directory.Exists(abpi_Outdate.Dir_Relative))
        {
            Directory.CreateDirectory(abpi_Outdate.Dir_Relative);
        }
        foreach (var f in files.Where(f => f.EndsWith(abpi.ExtName)))
        {
            List <ABDetailRecord> l = new List <ABDetailRecord>();
            tmpRecords.Add(f, l);
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(f);
            XmlNodeList nodeList = xmlDoc.SelectSingleNode(AssetBundleSettingHelper.xmlNode_Title).ChildNodes;
            foreach (XmlElement node in nodeList)
            {
                var abr = new ABDetailRecord();
                abr.InputXmlNode(node);
                tmpRecords[f].Add(abr);
            }
            //File.Move(f, Path.Combine(xmlDir_OutDate_Name, f.Substring(f.LastIndexOf(xmlDir_Name) + xmlDir_Name.Length + 1)));
        }
        Analysis(tmpRecords);
    }