mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
[CLI] Partial assets reading
This commit is contained in:
parent
10b7e84ffb
commit
16a7107d4e
@ -12,6 +12,7 @@ namespace AssetStudio
|
||||
{
|
||||
public string SpecifyUnityVersion;
|
||||
public List<SerializedFile> assetsFileList = new List<SerializedFile>();
|
||||
private List<ClassIDType> filteredAssetTypesList = new List<ClassIDType>();
|
||||
|
||||
internal Dictionary<string, int> assetsFileIndexCache = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
internal Dictionary<string, BinaryReader> resourceFileReaders = new Dictionary<string, BinaryReader>(StringComparer.OrdinalIgnoreCase);
|
||||
@ -21,6 +22,37 @@ namespace AssetStudio
|
||||
private HashSet<string> noexistFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
private HashSet<string> assetsFileListHash = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public void SetAssetFilter(ClassIDType classIDType)
|
||||
{
|
||||
if (filteredAssetTypesList.Count == 0)
|
||||
{
|
||||
filteredAssetTypesList.AddRange(new List<ClassIDType>
|
||||
{
|
||||
ClassIDType.AssetBundle,
|
||||
ClassIDType.ResourceManager,
|
||||
});
|
||||
}
|
||||
|
||||
if (classIDType == ClassIDType.MonoBehaviour)
|
||||
{
|
||||
filteredAssetTypesList.AddRange(new List<ClassIDType>
|
||||
{
|
||||
ClassIDType.MonoScript,
|
||||
ClassIDType.MonoBehaviour
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
filteredAssetTypesList.Add(classIDType);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAssetFilter(List<ClassIDType> classIDTypeList)
|
||||
{
|
||||
foreach (ClassIDType classIDType in classIDTypeList)
|
||||
SetAssetFilter(classIDType);
|
||||
}
|
||||
|
||||
public void LoadFiles(params string[] files)
|
||||
{
|
||||
var path = Path.GetDirectoryName(Path.GetFullPath(files[0]));
|
||||
@ -404,6 +436,10 @@ namespace AssetStudio
|
||||
var objectReader = new ObjectReader(assetsFile.reader, assetsFile, objectInfo);
|
||||
try
|
||||
{
|
||||
if (filteredAssetTypesList.Count > 0 && !filteredAssetTypesList.Contains(objectReader.type))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Object obj;
|
||||
switch (objectReader.type)
|
||||
{
|
||||
|
@ -31,6 +31,7 @@ namespace AssetStudioCLI
|
||||
{
|
||||
var isLoaded = false;
|
||||
assetsManager.SpecifyUnityVersion = options.o_unityVersion.Value;
|
||||
assetsManager.SetAssetFilter(options.o_exportAssetTypes.Value);
|
||||
|
||||
if (Directory.Exists(options.inputPath))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user