GameObject (named 'Managers') references runtime script in scene file. Fixing!

I have an generic class I made that I want to use for my managers that inherits from MonoBehaviour. Since all my managers work the same way it makes the most sense to me. I also have the EnemyManager attached to a gameobject in the world.

The problem though is I get this error “GameObject (named ‘Managers’) references runtime script in scene file. Fixing!”

What am I doing wrong? Any help would be appreciated.

Here is my code:

public class Managers <T> where T : MonoBehaviour
{
    public virtual void Awake()
    {
    }

    public virtual void FixedUpdate()
    {
    }

    public virtual void Add(T obj)
    {
    }

    public virtual void Remove(int index)
    {
    }

    public virtual void RemoveAllObjects()
    {
    }
}

public class EnemyManager : Managers<Enemy>
{
    private static EnemyManager _instance;

    public static EnemyManager Instance
    {
        get
        {
            return _instance;
        }
    }
    
    public int MaxEnemies
    {
        get
        {
            return _maxEnemies;
        }
    }
    [SerializeField]
    [Range(0,100)]
    private int _maxEnemies;

    // Use this for initialization
    public override void Awake()
    {
        base.Awake();
        _instance = this;
    }

    public override void FixedUpdate()
    {
        base.FixedUpdate();
    }
}

Found a solution.

had to change

public class Managers <T> where T : MonoBehaviour

to

public class Managers<T> : MonoBehaviour where T : MonoBehaviour