Last active
June 18, 2021 12:58
-
-
Save tedliou/b9c3ac4d4835ebf6391985ec2ed0bccd 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 System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public static partial class Extension | |
{ | |
public static List<T> FindInterfacesOfType<T>(this GameObject _) | |
{ | |
return Object.FindObjectsOfType<MonoBehaviour>().OfType<T>().ToList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment