- Home /
Question by
wojtask12 · Jun 01, 2016 at 07:23 AM ·
c#inheritancegenericsfindobjectsoftype
FindObjectsOfType for abstract generic class
Hey guys, I was wondering if it's possible to find all objects in scene inheriting from abstract generic class, for example:
public abstract class Collectable<T> : MonoBehaviour
Now, I have:
public class Key : Collectable<Key>
and
public class Diamond : Collectable<Diamond>
Is there any way to find all the Collectables, ignoring their T?
Comment
Your answer
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
C# Inheriting from MonoBehaviour but still be able to instantiate with new()? How should I do this? 2 Answers
C# Generics not constraining correctly? 1 Answer
C# Generic Type Inheritance 2 Answers
Multiple Cars not working 1 Answer