// loop through the objects with a certain set of types, and process them // through a helper function void EachObject(EachObjectCallback fn, params RLCharacter.RLTypes[] validTypes) { // if (objects.Count > 0) { for (int i = objects.Count - 1; i >= 0; i--) { if (validTypes.Length > 0) { foreach (RLCharacter.RLTypes t in validTypes) { if (objects.Count > i && objects [i].hasTypes.Contains(t)) { fn(objects [i]); break; } } } else { fn(objects [i]); } } } }
// loop through the objects with a certain set of types, and process them // through a helper function void EachObject(EachObjectCallback fn, params RLCharacter.RLTypes[] validTypes) { // if (objects.Count > 0) { for (int i = objects.Count - 1; i >= 0; i--) { if (validTypes.Length > 0) { foreach (RLCharacter.RLTypes t in validTypes) { if (objects.Count > i && objects [i].hasTypes.Contains (t)) { fn (objects [i]); break; } } } else { fn (objects [i]); } } } }