SanAndreasUnity/Assets/Scripts/Importing/RenderWareStream/MaterialList.cs

26 lines
682 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using System;
using System.IO;
namespace SanAndreasUnity.Importing.RenderWareStream
{
[SectionType(8)]
public class MaterialList : SectionData
{
public readonly UInt32 MaterialCount;
public readonly Material[] Materials;
public MaterialList(SectionHeader header, Stream stream)
: base(header, stream)
{
var data = ReadSection<Data>();
MaterialCount = BitConverter.ToUInt32(data.Value, 0);
Materials = new Material[MaterialCount];
for (var i = 0; i < MaterialCount; ++i)
{
Materials[i] = ReadSection<Material>();
}
}
}
}