Skip to content

Instantly share code, notes, and snippets.

@tedliou
Last active June 18, 2021 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedliou/b9c3ac4d4835ebf6391985ec2ed0bccd to your computer and use it in GitHub Desktop.
Save tedliou/b9c3ac4d4835ebf6391985ec2ed0bccd to your computer and use it in GitHub Desktop.
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