docs.unity.cn
    Show / Hide Table of Contents

    Method InitEntityQueryCache

    InitEntityQueryCache(Int32)

    Initializes this system's internal cache of EntityQuery objects to the specified number of queries.

    Declaration
    protected void InitEntityQueryCache(int cacheSize)
    Parameters
    Type Name Description
    Int32 cacheSize

    The initial capacity of the system's EntityQuery array.

    Remarks

    A system's entity query cache expands automatically as you add additional queries. However, initializing the cache to the correct size when you initialize a system is more efficient and avoids unnecessary, garbage-collected memory allocations.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on 04 August 2022
    Terms of use