private void GetHairs(List <string> arr, List <HairsPart> Arr) { string lastType = ""; foreach (string path in arr) { String[] textSplit = path.Split("_"[0]); HairsPart part = new HairsPart(); part.type = textSplit[3]; part.sex = textSplit[1]; if (lastType != part.type) { Arr.Add(part); } lastType = part.type; } }
private void GetHairs(List<string> arr, List<HairsPart> Arr) { string lastType = ""; foreach (string path in arr) { String[] textSplit = path.Split("_"[0]); HairsPart part = new HairsPart(); part.type = textSplit[3]; part.sex = textSplit[1]; if(lastType != part.type) Arr.Add(part); lastType = part.type; } }