docs.unity.cn
    Show / Hide Table of Contents

    Method ShouldRunSystem

    ShouldRunSystem()

    Reports whether this system satisfies the criteria to update. This function is used internally to determine whether the system's OnUpdate function can be skipped.

    Declaration
    public bool ShouldRunSystem()
    Returns
    Type Description
    Boolean

    True if the system should be updated, or false if not.

    Remarks

    By default, systems will invoke OnUpdate every frame.

    If a system calls RequireForUpdate<T>() or RequireForUpdate(EntityQuery) in OnCreate, it will only update if all of its required components exist and required queries match existing chunks. This check uses IsEmptyIgnoreFilter, so the queries may still be empty if they use filters or Enableable Components.

    If a system has the RequireMatchingQueriesForUpdateAttribute it will update if any EntityQuery it uses match existing chunks. This check also uses IsEmptyIgnoreFilter, so all queries may still be empty if they use filters or Enableable Components.

    Note: Other factors might prevent a system from updating, even if this method returns true. For example, a system will not be updated if its Enabled property is false.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Thursday, August 10, 2023