I am using a method with a generic type T and need to call this method. The trick is that it can be of any child class from one class, so I would need the method call to be generic too. Is there a way to do that? Here's what I tried, by getting the type I needed, but it doesn't work since it's a variable:
private void InitializeEffects(PlainEffect[] _effects)
{
foreach (PlainEffect _effect in _effects)
{
Type _type = ConditionController.GetTypeByEnum(_effect.effectTrigger);
_effect.SubscribeEffect<_type>();
}
}