public bool IsBodyPartCollected(BodyPartTypes bodyPartType) { UIBodyPart part = this.GetBodyPart(bodyPartType); if (part != null) { return(part.IsCollected()); } return(false); }
private UIBodyPart GetBodyPart(BodyPartTypes partType) { UIBodyPart part = null; UIBodyPart[] partList = GameObject.FindObjectsOfType <UIBodyPart>(); foreach (UIBodyPart bodyPart in partList) { if (bodyPart.partType == partType) { part = bodyPart; } } return(part); }
public UIBodyPart RemoveBodyPart(BodyPartTypes bodyPartType) { foreach (UIBodyPart bodyPart in this.collectedParts) { if (bodyPart.partType == bodyPartType) { this.collectedParts.Remove(bodyPart); if (bodyPart.IsCorrect()) { this.correctPartCount--; print(this.correctPartCount); } bodyPart.Uncollect(); return(bodyPart); } } return(null); }