private void GatherChildren(Entity entity, NativeList <Entity> gatherer) { var children = new NativeList <Entity>(Allocator.TempJob); try { TransformHelpers.GetChildren(this, entity, ref children, true); for (var i = 0; i < children.Length; ++i) { var child = children[i]; gatherer.Add(child); GatherChildren(child, gatherer); } } finally { children.Dispose(); } }