如果我声明了一个泛型的Component
我是不是需要把每个实例化的Component的System都要写一遍。
public class TestComponent<T> : Entity, IAwake, IDestroy
{
}
public class LongTestComponentAwakeSystem : AwakeSystem<TestComponent<long>>
{
protected override void Awake(TestComponent<long> self)
{
TestComponentSystem<long>.Awake(self);
}
}
public class IntTestComponentAwakeSystem : AwakeSystem<TestComponent<int>>
{
protected override void Awake(TestComponent<int> self)
{
TestComponentSystem<int>.Awake(self);
}
}
直接写一个泛型的System语法上没问, 但实际无法执行, 有什么更好的替代方案吗
public class TestComponentAwakeSystem<T> : AwakeSystem<TestComponent<T>>
{
protected override void Awake(TestComponent<T> self)
{
}
}