Created
June 14, 2023 11:25
-
-
Save Raveler/f37bcde3092a744dfce31c08bf258643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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