dracon_interactive
dracon_interactive
CC#
Created by dracon_interactive on 1/18/2023 in #help
❔ How to reference a list of objects that derive from 'Class<T>', if T is different for all of them?
I have a manager class, Manager<T>. The child classes for this set T to their own type, due to a fun Unity singleton implementation. So you will see: - CameraManager: Manager<CameraManager> - GameManager: Manager<GameManager> Im trying some new things around my bootstrap process, and I wanted to be able to make a List<Manager> where I can iterate through them and call Manager<T>.Initialize(). However, my list declaration requires T to be quantified. Does anyone know how I might make the list accept the various generic implementations?
6 replies