I am creating an event system for a game, I have the Abstract Class Event, and different subclasses, so far, I have made specific Methods for the creation of Each, but I would like to create them directly of their specified type
public void CreateEvent (Type t)
{
GameObject NewEvent = new GameObject();
NewEvent.AddComponent<t>();
}
This code gives an error message:
t is a variable but is used as a Type