public static BodyPartModel GetPart(CreatureBody.BodyCategory category, CreatureRaw race, CasteRaw caste, BodyPartRaw part) { if (categoryParts == null) { LoadDefaultBodyParts(); } BodyPartModel partModel = null; var bodyDef = GetBodyDefinition(race, caste); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(race); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(category); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } return(partModel); }
public static BodyPartModel GetPart(CreatureBody.BodyCategory category, CreatureRaw race, CasteRaw caste, BodyPartRaw part) { Gender gender = Gender.Neuter; if (caste != null) { gender = (Gender)caste.gender; } BodyPartModel partModel = null; var bodyDef = GetBodyDefinition(race, caste); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(race); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(category, gender); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(category, Gender.Neuter); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } if (partModel != null) { return(partModel); } bodyDef = GetBodyDefinition(CreatureBody.BodyCategory.None); if (bodyDef != null) { partModel = bodyDef.GetPart(part); } return(partModel); }