コード例 #1
0
ファイル: ComponentSystem.cs プロジェクト: qntnt/platformer
        protected override void OnBeforeCreateManagerInternal(World world)
        {
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            m_SystemID = World.AllocateSystemID();
#endif
            m_World         = world;
            m_EntityManager = world.GetOrCreateManager <EntityManager>();
            m_SafetyManager = m_EntityManager.ComponentJobSafetyManager;

            m_ComponentGroups = new ComponentGroup[0];
#if !UNITY_CSHARP_TINY
            m_CachedComponentGroupArrays = new ComponentGroupArrayStaticCache[0];
            m_AlwaysUpdateSystem         = GetType().GetCustomAttributes(typeof(AlwaysUpdateSystemAttribute), true).Length != 0;
#else
            m_AlwaysUpdateSystem = true;
#endif
            m_JobDependencyForReadingManagers = new NativeList <int>(10, Allocator.Persistent);
            m_JobDependencyForWritingManagers = new NativeList <int>(10, Allocator.Persistent);

#if !UNITY_ZEROPLAYER
            ComponentSystemInjection.Inject(this, world, m_EntityManager, out m_InjectedComponentGroups, out m_InjectFromEntityData);
            m_InjectFromEntityData.ExtractJobDependencyTypes(this);
#endif
            InjectNestedIJobProcessComponentDataJobs();

            UpdateInjectedComponentGroups();
        }
コード例 #2
0
        protected override void OnBeforeCreateManagerInternal(World world, int capacity)
        {
            m_World              = world;
            m_EntityManager      = world.GetOrCreateManager <EntityManager>();
            m_SafetyManager      = m_EntityManager.ComponentJobSafetyManager;
            m_AlwaysUpdateSystem = GetType().GetCustomAttributes(typeof(AlwaysUpdateSystemAttribute), true).Length != 0;

            m_ComponentGroups                 = new ComponentGroup[0];
            m_CachedComponentGroupArrays      = new ComponentGroupArrayStaticCache[0];
            m_JobDependencyForReadingManagers = new NativeList <int>(10, Allocator.Persistent);
            m_JobDependencyForWritingManagers = new NativeList <int>(10, Allocator.Persistent);

            ComponentSystemInjection.Inject(this, world, m_EntityManager, out m_InjectedComponentGroups, out m_InjectFromEntityData);
            m_InjectFromEntityData.ExtractJobDependencyTypes(this);

            UpdateInjectedComponentGroups();
        }