(ResourcesAsset): constructor argument is filename.

This commit is contained in:
morkt 2018-09-02 23:48:28 +04:00
parent 88c8cf96a3
commit ddf2996774
2 changed files with 7 additions and 5 deletions

View File

@ -135,7 +135,7 @@ namespace GameRes.Formats.Unity.Gx4Lib
long base_pos = asset_pos + header_size - 4;
input.Position = base_pos;
var index = new ResourcesAssetsDeserializer (arc.File);
var index = new ResourcesAssetsDeserializer (arc.File.Name);
var dir = index.Parse (input, base_pos);
if (null == dir || 0 == dir.Count)
return base.OpenEntry (arc, entry);;

View File

@ -33,9 +33,9 @@ namespace GameRes.Formats.Unity
string m_res_name;
Dictionary<string, BundleEntry> m_bundles;
public ResourcesAssetsDeserializer (ArcView file)
public ResourcesAssetsDeserializer (string arc_name)
{
m_res_name = file.Name;
m_res_name = arc_name;
}
public List<Entry> Parse (AssetReader input, long base_offset = 0)
@ -50,8 +50,11 @@ namespace GameRes.Formats.Unity
{
input.Position = obj.Offset + base_offset;
AssetEntry entry = null;
switch (obj.TypeId)
int id = obj.TypeId > 0 ? obj.TypeId : obj.ClassId;
switch (id)
{
case 48: // Shader
case 114: // MonoBehaviour
default:
break;
@ -126,7 +129,6 @@ namespace GameRes.Formats.Unity
entry.Type = "image";
break;
}
case 114: // MonoBehaviour
case 128: // Font
{
entry = new AssetEntry {