Пример #1
0
        public override void SortSystemUpdateList()
        {
            // Extract list of systems to sort (excluding built-in systems that are inserted at fixed points)
            var toSort = new List <ComponentSystemBase>(m_systemsToUpdate.Count - 3);

            foreach (var s in m_systemsToUpdate)
            {
                if (s is BeginSimulationEntityCommandBufferSystem ||
                    s is LateSimulationSystemGroup ||
                    s is EndSimulationEntityCommandBufferSystem)
                {
                    continue;
                }
                toSort.Add(s);
            }
            m_systemsToUpdate = toSort;
            base.SortSystemUpdateList();
            m_lateSimulationGroup.SortSystemUpdateList(); // not handled by base-class sort call
            // Re-insert built-in systems to construct the final list
            var finalSystemList = new List <ComponentSystemBase>(1 + m_systemsToUpdate.Count + 2);

            finalSystemList.Add(m_BeginEntityCommandBufferSystem);
            foreach (var s in m_systemsToUpdate)
            {
                finalSystemList.Add(s);
            }
            finalSystemList.Add(m_lateSimulationGroup);
            finalSystemList.Add(m_EndEntityCommandBufferSystem);
            m_systemsToUpdate = finalSystemList;
        }
Пример #2
0
        public override void SortSystemUpdateList()
        {
            // Extract list of systems to sort (excluding built-in systems that are inserted at fixed points)
            var toSort = new List <ComponentSystemBase>(m_systemsToUpdate.Count);
            BeginSimulationEntityCommandBufferSystem beginEcbSys = null;
            LateSimulationSystemGroup lateSysGroup           = null;
            EndSimulationEntityCommandBufferSystem endEcbSys = null;

            foreach (var s in m_systemsToUpdate)
            {
                if (s is BeginSimulationEntityCommandBufferSystem)
                {
                    beginEcbSys = (BeginSimulationEntityCommandBufferSystem)s;
                }
                else if (s is LateSimulationSystemGroup)
                {
                    lateSysGroup = (LateSimulationSystemGroup)s;
                    lateSysGroup.SortSystemUpdateList(); // not handled by base-class sort call below
                }
                else if (s is EndSimulationEntityCommandBufferSystem)
                {
                    endEcbSys = (EndSimulationEntityCommandBufferSystem)s;
                }
                else
                {
                    toSort.Add(s);
                }
            }
            m_systemsToUpdate = toSort;
            base.SortSystemUpdateList();
            // Re-insert built-in systems to construct the final list
            var finalSystemList = new List <ComponentSystemBase>(toSort.Count);

            if (beginEcbSys != null)
            {
                finalSystemList.Add(beginEcbSys);
            }
            foreach (var s in m_systemsToUpdate)
            {
                finalSystemList.Add(s);
            }
            if (lateSysGroup != null)
            {
                finalSystemList.Add(lateSysGroup);
            }
            if (endEcbSys != null)
            {
                finalSystemList.Add(endEcbSys);
            }
            m_systemsToUpdate = finalSystemList;
        }