Skip to content

Instantly share code, notes, and snippets.

@Raveler
Created June 14, 2023 11:25
Show Gist options
  • Save Raveler/f37bcde3092a744dfce31c08bf258643 to your computer and use it in GitHub Desktop.
Save Raveler/f37bcde3092a744dfce31c08bf258643 to your computer and use it in GitHub Desktop.
using UnityEngine;
public static class TransformExtension
{
public static T[] GetAllComponentsInChildren<T>(this Transform transform)
{
return transform.GetComponentsInChildren<T>(true);
}
public static T[] GetAllComponentsInParent<T>(this Transform transform)
{
return transform.GetComponentsInParent<T>(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment