using FishNet.Object; using System.Collections.Generic; using UnityEngine; namespace FishNet.Utility.Performance { public static class GetNonAlloc { /// /// Gets all NetworkBehaviours on a transform. /// public static void GetNetworkBehavioursNonAlloc(this Transform t, ref List results) { t.GetComponents(results); } /// /// Gets all transforms on transform and it's children. /// public static void GetTransformsInChildrenNonAlloc(this Transform t, ref List results, bool includeInactive = false) { t.GetComponentsInChildren(includeInactive, results); } } }