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); }
private void LoadSkin() { var bodyPart = BodyPartRecord.GetBodyPart(race, BodyPartPiece.Chest, isFemale); BodyPartRecord.Create(bodyPart, null, transform); }