Nez.Portable/ECS/InternalUtils/EntityList.cs
/// <summary>
/// returns all Components found in the Scene of type T. The returned List can be put back in the pool via ListPool.free.
/// </summary>
/// <returns>The components of type.</returns>
/// <typeparam name="T">The 1st type parameter.</typeparam>
returns all Components found in the Scene of type T. The returned List can be put back in the pool via ListPool.free.
returns all Components found in the Scene of type T . The returned List can be put back in the pool via ListPool . free .
public List<T> findComponentsOfType<T>()
            where T : Component
        {
            var comps = ListPool<T>.obtain();
            for (var i = 0; i < _entities.length; i++)
            {
                if (_entities.buffer[i].enabled)
                    _entities.buffer[i].getComponents<T>(comps);
            }
            foreach (var entity in _entitiesToAdd)
            {
                if (entity.enabled)
                {
                    entity.getComponents<T>(comps);
                }
            }
            return comps;
        }
public List < T > findComponentsOfType < T > ( ) where T : Component { var comps = ListPool < T > . obtain ( ) ; for ( var i = 0 ; i < _entities . length ; i ++ ) { if ( _entities . buffer [ i ] . enabled ) _entities . buffer [ i ] . getComponents < T > ( comps ) ; } foreach ( var entity in _entitiesToAdd ) { if ( entity . enabled ) { entity . getComponents < T > ( comps ) ; } } return comps ; }
returns all Components found in the Scene of type T. The returned List can be put back in the pool via ListPool.free.
returns all Components found in the Scene of type T . The returned List can be put back in the pool via ListPool . free .
The components of type.
The components of type .
typeparam
The 1st type parameter.
The 1st type parameter .