This commit is contained in:
Razmoth
2023-04-01 17:51:33 +04:00
parent 29e99495de
commit c7d60450f8
25 changed files with 1077 additions and 735 deletions

View File

@@ -1,7 +1,4 @@
using System.Collections.Generic;
using System.Linq;
namespace AssetStudio
namespace AssetStudio
{
public class ObjectInfo
{
@@ -14,20 +11,5 @@ namespace AssetStudio
public long m_PathID;
public SerializedType serializedType;
public static List<ObjectInfo> Filter(List<ObjectInfo> objects) => objects.Where(x => x.IsExportableType()).OrderBy(x => ExportableTypes.IndexOf((ClassIDType)x.typeID)).ToList();
private bool IsExportableType()
{
var typeID = (ClassIDType)classID;
var isExportableType = ExportableTypes.Contains(typeID);
return typeID switch
{
ClassIDType.IndexObject or ClassIDType.MiHoYoBinData => isExportableType && MiHoYoBinData.Exportable,
_ => isExportableType,
};
}
private readonly static List<ClassIDType> ExportableTypes = new List<ClassIDType> { ClassIDType.GameObject, ClassIDType.IndexObject, ClassIDType.Material, ClassIDType.Texture2D, ClassIDType.Mesh, ClassIDType.Shader, ClassIDType.TextAsset, ClassIDType.AnimationClip, ClassIDType.Font, ClassIDType.Sprite, ClassIDType.Animator, ClassIDType.MiHoYoBinData, ClassIDType.AssetBundle };
}
}