コード例 #1
0
    protected void AddSystem(SystemBase system)
    {
        var type = system.GetType();

        if (dSystems.ContainsKey(type))
        {
            throw new Exception($"Duplicate system {type}");
        }
        dSystems.Add(type, system);
    }
コード例 #2
0
    public ECSGroupManager(WorldBase world)
    {
        //this.world = world;

        for (int i = 0; i < world.m_systemList.Count; i++)
        {
            SystemBase system = world.m_systemList[i];
            string     name   = system.GetType().FullName;
            ECSGroup   group  = new ECSGroup(name, system.Filter);
            allGroupDic.Add(name, group);
            groupToEntityDic.Add(group, new List <EntityBase>());
        }
        for (int i = 0; i < world.m_recordList.Count; i++)
        {
            RecordSystemBase system = world.m_recordList[i];
            string           name   = system.GetType().FullName;
            ECSGroup         group  = new ECSGroup(name, system.Filter);
            allGroupDic.Add(name, group);
            groupToEntityDic.Add(group, new List <EntityBase>());
        }
    }