SanAndreasUnity/Assets/Scripts/Importing/RenderWareStream/MaterialList.cs
2020-05-31 19:07:22 +02:00

26 lines
No EOL
682 B
C#

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>();
}
}
}
}