private bool RecurseCheckChildren(FastCollection <TransformComponent> children, TransformComponent targetTransform) { foreach (var transformComponentChild in children) { if (transformComponentChild.Parent == null) { continue; // skip this case, the parent has not updated it's list yet } if (!RecurseCheckChildren(transformComponentChild.Children, targetTransform)) { return(false); } if (targetTransform.Entity.Id != transformComponentChild.Entity.Id) { continue; } return(false); } return(true); }