Find all GameObjects containing scripts, which are derived from abstract class.

Hello,

I have a problem finding all GameObjects in the scene containing scripts, which are derived from an abstract class.

Situation looks like this:

public abstract class IAbstractInterface: MonoBehaviour
{
}

public class Item_I_Need_To_Find1 : IAbstractInterface
{
}

public class Item_I_Need_To_Find2 : IAbstractInterface
{
}

....

How can I find all gameobject in the scene containing Item_I_Need_To_Find(%number%) scripts?

I would really appreciate any help.

Thanks in advance.

Use UnityEngine.Object.FindObjectsOfType< IAbstractInterface >(); That will give you back all objects that inherit IAbstractInterface