public SklData1(SklHeader header, BinaryReader reader) : base(header, reader) { this.Magic = reader.ReadBytes(8); this.ObjCount = reader.ReadInt32(); this.Hash = reader.ReadInt32(); this.SklCount = reader.ReadInt32(); this.Bones = new SklBoneData1[this.SklCount]; for (int i = 0; i < this.SklCount; i++) { this.Bones[i] = new SklBoneData1(reader); } }
public SklData0(SklHeader header, BinaryReader reader) : base(header, reader) { int un = reader.ReadInt16(); int boneCount = reader.ReadInt16(); int boneIndexCount = reader.ReadInt32(); this.Bones = new SklBoneData0[boneCount]; this.bonesStart = reader.ReadInt32(); this.animationStart = reader.ReadInt32(); this.boneIndicesStart = reader.ReadInt32(); this.boneIndicesEnd = reader.ReadInt32(); this.halfayBetweenBoneindicesAndStrings = reader.ReadInt32(); this.boneNamesStart = reader.ReadInt32(); var gap = reader.ReadBytes(20); for (int i = 0; i < boneCount; i++) { Bones[i] = new SklBoneData0(reader); } this.BoneExtra = new SklBoneExtra[boneCount]; for (int i = 0; i < boneCount; i++) { this.BoneExtra[i] = new SklBoneExtra(reader); } reader.BaseStream.Seek(boneNamesStart, SeekOrigin.Begin); for (int i = 0; i < boneCount; i++) { string name = ""; string c = ""; do { c = new string(reader.ReadChars(4)); name += c; }while (c.IndexOf('\0') == -1); BoneNames.Add(name.Substring(0, name.IndexOf('\0'))); } foreach (var item in this.Bones) { item.Name = BoneNames[item.Id]; } }
public SklBaseData(SklHeader header, BinaryReader reader) { this.header = header; this.reader = reader; }