using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; public class PtgFile { private List _timData = new List(); public List Textures { get { return _timData; } } public static PtgFile Parse(byte[] data) { PtgFile result = new PtgFile(); MemoryStream src = new MemoryStream(data); BinaryReader r = new BinaryReader(src); var texCount = r.ReadInt32(); var texSize = (data.Length - 4) / texCount; for (int i = 0; i < texCount; ++i) { var texData = r.ReadBytes(texSize); result._timData.Add(TimFile.Parse(texData)); } return result; } }