public void CreateEquippedPart(Transform child, BipedPart part) { BodyPartPiece bodyPartType; if (bodyPartNames.TryGetValue(part, out bodyPartType)) { BodyPartRecord bodyPart = null; switch (bodyPartType) { case BodyPartPiece.Head: bodyPart = head; break; case BodyPartPiece.Hair: bodyPart = hair; break; case BodyPartPiece.Chest: LoadSkin(); break; case BodyPartPiece.Hand: break; case BodyPartPiece.Foot: if (!race.IsBeastRace) { bodyPart = BodyPartRecord.GetBodyPart(race, bodyPartType, isFemale); } break; case BodyPartPiece.None: break; default: bodyPart = BodyPartRecord.GetBodyPart(race, bodyPartType, isFemale); break; } if (bodyPart != null) { BodyPartRecord.Create(bodyPart, null, child); } } var equippedPart = new EquippedPart(child); bodyPartPairs.Add(part, equippedPart); }
public static void Create(BinaryReader reader) { var header = new RecordHeader(reader); switch (header.Type) { case RecordType.BirthSign: BirthSignRecord.Create(reader, header); break; case RecordType.BodyPart: BodyPartRecord.Create(reader, header); break; case RecordType.Cell: CellRecord.Create(reader, header); break; case RecordType.Dialogue: DialogRecord.Create(reader, header); break; case RecordType.GameSetting: GameSetting.Create(reader, header); break; case RecordType.Info: InfoRecord.Create(reader, header); break; case RecordType.Land: LandRecord.Create(reader, header); break; case RecordType.LandTexture: LandTextureRecord.Create(reader, header); break; case RecordType.MagicEffect: MagicEffectRecord.Create(reader, header); break; case RecordType.PathGrid: Pathgrid.Create(reader, header); break; case RecordType.Script: Script.Create(reader, header); break; case RecordType.Skill: SkillRecord.Create(reader, header); break; case RecordType.SoundGenerator: SoundGenerator.Create(reader, header); break; case RecordType.Tes3: Tes3Record.Create(reader, header); break; default: { var size = GotoSubrecord(SubRecordType.Id, header); var id = reader.ReadString(size); reader.BaseStream.Position = header.DataOffset + header.DataSize; var recordData = CreateRecordData(header.Type); recordData.Header = header; Records.Add(id, recordData); break; } } }
private void LoadSkin() { var bodyPart = BodyPartRecord.GetBodyPart(race, BodyPartPiece.Chest, isFemale); BodyPartRecord.Create(bodyPart, null, transform); }