How can I get the name of a class into a script from the editor.

I’m making a game with multiple game modes and the best way I found to do what I want is to make an abstract base class for my TileManager and then inherit from it. This is all fine until I realized I needed to add a certain script, which I’d like to change in the editor, to a prefab that I Instantiate in some method. So here’s some “code”.

override public void createSlots()
{
      public ScriptName ReferenceFromEditor;
       .
       .
       .
      GameObject slot = (GameObject)Instantiate(tileSlot, new Vector3(-camWidth + (i + 1) * distBetweenTiles - boxSizeX / 2, topLeft.y - curRow * boxSizeY * 2), Quaternion.identity);
       slot.AddComponent<ReferenceFromEditor>();
}

So what I want to know is what to replace "ScriptName ReferenceFromEditor " with so I can get a reference to a script name from the editor.

The question might be better reworded as how can I use the editor with AddComponent<>().

Do you mean:

public Component ReferenceFromEditor;

Then you can assign any script in the editor to be attached with AddComponent.