Voxel LoadFile(Pair <string, string> files) { var vxl = new VxlReader(FileSystem.OpenWithExts(files.First, ".vxl")); var hva = new HvaReader(FileSystem.OpenWithExts(files.Second, ".hva")); return(new Voxel(this, vxl, hva)); }
void Start() { Map map = new VxlReader().LoadMap(System.IO.File.ReadAllBytes(GetMapPath(MapName))); if (map != null) { Debug.Log("DONE!"); } }
Voxel LoadFile(Pair<string, string> files) { VxlReader vxl; HvaReader hva; using (var s = fileSystem.Open(files.First + ".vxl")) vxl = new VxlReader(s); using (var s = fileSystem.Open(files.Second + ".hva")) hva = new HvaReader(s, files.Second + ".hva"); return new Voxel(this, vxl, hva); }
Voxel LoadFile(Pair <string, string> files) { VxlReader vxl; HvaReader hva; using (var s = GlobalFileSystem.OpenWithExts(files.First, ".vxl")) vxl = new VxlReader(s); using (var s = GlobalFileSystem.OpenWithExts(files.Second, ".hva")) hva = new HvaReader(s); return(new Voxel(this, vxl, hva)); }
public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva) { if (vxl.LimbCount != hva.LimbCount) { throw new InvalidOperationException("Voxel and hva limb counts don't match"); } transforms = hva.Transforms; Frames = hva.FrameCount; Limbs = hva.LimbCount; limbData = new Limb[vxl.LimbCount]; for (var i = 0; i < vxl.LimbCount; i++) { var vl = vxl.Limbs[i]; var l = new Limb(); l.Scale = vl.Scale; l.Bounds = (float[])vl.Bounds.Clone(); l.Size = (byte[])vl.Size.Clone(); l.RenderData = loader.GenerateRenderData(vxl.Limbs[i]); limbData[i] = l; } }
public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva, (string Vxl, string Hva) files)