docs.unity.cn
    Show / Hide Table of Contents

    Method WithDisabled

    WithDisabled<T1>()

    Add required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.

    WithDisabled accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithDisabled<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithDisabledRW``1(``0@)

    WithDisabled<T1, T2>()

    Add required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.

    WithDisabled accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithDisabled<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithDisabledRW``1(``0@)

    WithDisabled<T1, T2, T3>()

    Add required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2, T3>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2
    T3

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.

    WithDisabled accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithDisabled<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithDisabledRW``1(``0@)

    WithDisabled<T1, T2, T3, T4>()

    Add required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2, T3, T4>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2
    T3
    T4

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.

    WithDisabled accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithDisabled<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithDisabledRW``1(``0@)

    WithDisabled<T1, T2, T3, T4, T5>()

    Add required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2, T3, T4, T5>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2
    T3
    T4
    T5

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.

    WithDisabled accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithDisabled<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithDisabledRW``1(``0@)

    WithDisabled<T1, T2, T3, T4, T5, T6>()

    Add required component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2, T3, T4, T5, T6>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2
    T3
    T4
    T5
    T6

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types.

    WithAll accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithAll<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithAllRW``1(``0@)

    WithDisabled<T1, T2, T3, T4, T5, T6, T7>()

    Add required component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithDisabled<T1, T2, T3, T4, T5, T6, T7>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2
    T3
    T4
    T5
    T6
    T7

    A required disabled component type

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types.

    WithAll accepts up to seven type arguments. You can add more component types by chaining calls together.

               var query = new EntityQueryBuilder(Allocator.Temp)
                   .WithAll<ObjectPosition, ObjectVelocity>()
                   .WithAll<ObjectRotation, ObjectRotationSpeed>()
                   .Build(this);

    To add component types that are not known at compile time, use WithAll<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithAllRW``1(``0@)

    WithDisabled<T>(ref T)

    Add a list of required disabled component types to the query.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(FixedList32Bytes<ComponentType>)})]
    public EntityQueryBuilder WithDisabled<T>(ref T componentTypes)
        where T : INativeList<ComponentType>
    Parameters
    Type Name Description
    T componentTypes

    A list of component types that implements INativeList<T>. For example, NativeList<T> or FixedList64Bytes<T>

    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T

    A container of component types

    Remarks

    To match the resulting query, an Entity must have all of the query's required component types, and they must all be disabled.

    There are several ways to exclude components from a query:

    • WithAbsent<T>() matches all entities in chunks that do not have T at all.
    • WithDisabled<T>() matches chunks that must have T, but only matches entities where T is disabled.
    • WithNone<T>() matches both of the above cases: either the component isn't present at all, or it is present but disabled.
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023