/// <summary>
        /// 校正数据
        /// </summary>
        public void MatchData(Action <string> progress_report)
        {
            string path = EditorCommon.RelativeToAbsolutePath(Data.BuildStartLocalPath);

            MatchAssetRuleElement(path, Data.Assets.Root, progress_report);
            MatchSceneRuleData(ref Data.Scenes, progress_report);
        }
예제 #2
0
        /// <summary>
        ///   添加选中的资源数据至包中
        /// </summary>
        public void AddSelectionAsset(ResourcesPackagesData.Package pack)
        {
            if (pack == null)
            {
                return;
            }

            foreach (var id in Selection.instanceIDs)
            {
                string str       = AssetDatabase.GetAssetPath(id);
                string full_name = EditorCommon.RelativeToAbsolutePath(str);
                if (System.IO.File.Exists(full_name))
                {
                    if (!EditorCommon.IsIgnoreFile(str))
                    {
                        if (!pack.AssetList.Contains(str))
                        {
                            str = str.ToLower();
                            pack.AssetList.Add(str);
                        }
                    }
                }
                else if (System.IO.Directory.Exists(str))
                {
                    System.IO.DirectoryInfo dic = new System.IO.DirectoryInfo(str);
                    foreach (var file in dic.GetFiles("*", System.IO.SearchOption.AllDirectories))
                    {
                        string local = EditorCommon.AbsoluteToRelativePath(file.FullName);
                        if (!string.IsNullOrEmpty(local) && !EditorCommon.IsIgnoreFile(local))
                        {
                            if (!pack.AssetList.Contains(local))
                            {
                                local = local.ToLower();
                                pack.AssetList.Add(local);
                            }
                        }
                    }
                }
            }
        }