Beispiel #1
0
        public string GetAssetLabel(EditorAssetInfo asset, string buildRootPath)
        {
            var buildPath = FileHelper.AssetPathToBuildPath(buildRootPath, asset.AssetPath);

            if (string.IsNullOrEmpty(buildPath))
            {
                return(null);
            }

            return(AssetLabelConfig.GetAssetLabel(asset.AssetPath, asset.Extension, buildPath, asset.Guid));
        }
Beispiel #2
0
        public bool CheckDirectoryLabel(EditorAssetInfo asset, string buildRootPath)
        {
            var buildPath = FileHelper.AssetPathToBuildPath(buildRootPath, asset.AssetPath);

            if (string.IsNullOrEmpty(buildPath))
            {
                return(false);
            }

            return(AssetLabelConfig.CheckDirectoryLabel(asset.AssetPath, buildPath));
        }
Beispiel #3
0
        public bool CheckFileAvailable(EditorAssetInfo asset, string buildRootPath)
        {
            var buildPath = FileHelper.AssetPathToBuildPath(buildRootPath, asset.AssetPath);

            if (string.IsNullOrEmpty(buildPath))
            {
                return(false);
            }

            return(AssetLabelConfig.CheckFileAvailable(asset.AssetPath, asset.Name, asset.Extension, buildPath));
        }
 public EditorAssetInfo(EditorAssetInfo copy)
 {
     IsAsset         = copy.IsAsset;
     Name            = copy.Name;
     AssetPath       = copy.AssetPath;
     Extension       = copy.Extension;
     AssetBundleName = copy.AssetBundleName;
     Version         = copy.Version;
     CRC             = copy.CRC;
     Guid            = copy.Guid;
     Hash            = copy.Hash;
     Size            = copy.Size;
     Date            = copy.Date;
     UnityVersion    = copy.UnityVersion;
 }
Beispiel #5
0
        private static List <EditorAssetInfo> buildTreeViewItemRecursive(DirectoryInfo dirInfo, EditorAssetInfo parent, int depth)
        {
            var items = new List <EditorAssetInfo>();
            var item  = getTreeViewItem(FileHelper.SystemPathToAssetPath(dirInfo.FullName), depth);

            item.Initialize(FileHelper.SystemPathToAssetPath(dirInfo.FullName));
            if (depth != -1)
            {
                items.Add(item);
            }

            var fileInfos = dirInfo.GetFiles("*.*").ToList();

            fileInfos.RemoveAll(f => Path.GetExtension(f.Name).Equals(".meta"));
            for (int i = 0; i < fileInfos.Count; i++)
            {
                var assetPath = FileHelper.SystemPathToAssetPath(fileInfos[i].FullName);
                var child     = getTreeViewItem(assetPath, depth + 1);
                child.Initialize(assetPath);
                items.Add(child);
            }
            //myRoot.children = items;

            foreach (DirectoryInfo di in dirInfo.GetDirectories())
            {
                items.AddRange(buildTreeViewItemRecursive(di, item, depth + 1));
            }

            return(items);
        }