Convert UnityEngine.Component to T

I need to convert a bound (UnityEngine.Component) List to a generic (T) List, is this possible? how?


That’s not really how generics work. The T in a generic is filled in when you call a function or instantiate a class.

 public class myClass<T>
      public List<T> someList = new List<T>();

Then later

 var anObject = new myClass<string>();
anObject.someList.Add("Hello world");

var anotherOther = new myClass<int>();

The List has been created from the generic parameters when I constructed the class.

Perhaps edit the question if your problem is actually something different…