Exemple #1
0
        public static void Scan(BundleBuilderData data, BundleBuilderData.BundleInfo bundle, BundleBuilderData.BundleAssetTarget target)
        {
            var extensions = target.extensions?.Split(';');
            var filter     = new AssetFilter()
            {
                size       = bundle.splitObjects,
                extensions = extensions,
                types      = target.types,
            };

            Scan(data, bundle, filter, target.target);
        }
Exemple #2
0
        public static void Scan(BundleBuilderData data, BundleBuilderData.BundleInfo bundle, BundleBuilderData.BundleAssetTarget target, Object asset)
        {
            if (asset == null)
            {
                return;
            }
            var targetPath = AssetDatabase.GetAssetPath(asset);

            if (Directory.Exists(targetPath))
            {
                // 是一个目录
                foreach (var directory in Directory.GetDirectories(targetPath))
                {
                    Scan(data, bundle, target, AssetDatabase.LoadMainAssetAtPath(directory));
                }
                foreach (var file in Directory.GetFiles(targetPath))
                {
                    if (file.EndsWith(".meta"))
                    {
                        continue;
                    }
                    var fileAsset = AssetDatabase.LoadMainAssetAtPath(file);
                    Scan(data, bundle, target, fileAsset);
                }
            }
            else
            {
                if (CollectAsset(data, bundle, asset))
                {
                    if (bundle.AddAssetOrder(asset))
                    {
                        data.MarkAsDirty();
                    }
                }
            }
        }
 public BundleBuilderTreeViewTarget(int id, int depth, string displayName, BundleBuilderData.BundleAssetTarget assetTarget)
     : base(id, depth, displayName)
 {
     this.assetTarget = assetTarget;
 }
Exemple #4
0
 public static void Scan(BundleBuilderData data, BundleBuilderData.BundleInfo bundle, BundleBuilderData.BundleAssetTarget target)
 {
     Scan(data, bundle, target, target.target);
 }