示例#1
0
        private int calcAssetsInChildren(AssetHunterProjectFolderInfo assetFolderInfo, SortedDictionary <AssetHunterSerializableSystemType, bool> validTypeList, out long folderFileSize)
        {
            assetFolderInfo.m_fileSize = assetFolderInfo.GetUnusedAssetSize();

            long childrenSizeAccumulated = 0;

            int value = 0;

            foreach (int indexer in assetFolderInfo.m_childFolderIndexers)
            {
                long childSize = 0;
                value += AssetHunterMainWindow.Instance.GetFolderList()[indexer].m_assetsInChildren = calcAssetsInChildren(AssetHunterMainWindow.Instance.GetFolderList()[indexer], validTypeList, out childSize);

                childrenSizeAccumulated += childSize;
            }

            List <AssetObjectInfo> assetInfoList = (assetFolderInfo.AssetList.Where(val => (validTypeList.ContainsKey(val.m_Type) && validTypeList[val.m_Type]) == true)).ToList <AssetObjectInfo>();

            assetFolderInfo.m_fileSizeString      = AssetHunterHelper.BytesToString(assetFolderInfo.m_fileSize);
            assetFolderInfo.m_fileSizeAccumulated = assetFolderInfo.m_fileSize + childrenSizeAccumulated;

            assetFolderInfo.m_fileSizeAccumulatedString = AssetHunterHelper.BytesToString(assetFolderInfo.m_fileSizeAccumulated);

            folderFileSize = assetFolderInfo.m_fileSizeAccumulated;

            return(value + assetInfoList.Count());
        }
示例#2
0
 public AssetObjectInfo(string path, AssetHunterSerializableSystemType type)
 {
     this.m_Path = path;
     string[] parts = path.Split('/');
     this.m_Name = parts[parts.Length - 1];
     this.m_Type = type;
     System.IO.FileInfo fileInfo = new System.IO.FileInfo(path);
     this.m_FileSize       = fileInfo.Length;
     this.m_FileSizeString = AssetHunterHelper.BytesToString(m_FileSize);
 }