Dictionary to Stack Class Types Together
问题 Enemy classes involved: public abstract Enemy : MonoBehaviour {} public class A : Enemy {} public class B : Enemy {} I have a dictionary. I want make the dictionary contain a stack for every type of Enemy. public class Test : MonoBehaviour { // prefabs public GameObject a, b; public Dictionary<Enemy, Stack> eDictionary; void Start() { eDictionary = new Dictionary<Enemy, Stack>(); Fill(a, 10); Fill(b, 10); } } How I make the stack and keys. public void Fill(Enemy e, int howMany) { Stack s =