public static PmxDisplayItem Parse(BinaryReader br, PmxDocument doc) { switch ((PmxDisplayItemKind)br.ReadByte()) { case PmxDisplayItemKind.Bone: return new PmxBoneDisplayItem { Bone = doc.ReadBone(br), }; case PmxDisplayItemKind.Morph: return new PmxMorphDisplayItem { Morph = doc.ReadMorph(br), }; default: throw new InvalidOperationException(); } }
public override void Read(BinaryReader br, PmxDocument doc) { this.Morph = doc.ReadMorph(br); this.Weight = br.ReadSingle(); }