docs.unity3d.com
Search Results for

    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
    bool

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)