docs.unity3d.com
    Show / Hide Table of Contents

    Method OnUpdate

    OnUpdate(JobHandle)

    Implement OnUpdate to perform the major work of this system.

    Declaration
    protected abstract JobHandle OnUpdate(JobHandle inputDeps)
    Parameters
    Type Name Description
    JobHandle inputDeps

    Existing dependencies for this system.

    Returns
    Type Description
    JobHandle

    A Job handle that contains the dependencies of the Jobs in this system.

    Remarks

    The system invokes OnUpdate once per frame on the main thread when any of this system's EntityQueries match existing entities, or if the system has the AlwaysUpdate attribute.

    To run a Job, create an instance of the Job struct, assign appropriate values to the struct fields and call one of the Job schedule functions. The system passes any current dependencies between Jobs -- which can include Jobs internal to this system, such as gathering entities or chunks, as well as Jobs external to this system, such as Jobs that write to the components read by this system -- in the inputDeps parameter. Your function must combine the input dependencies with any dependencies of the Jobs created in OnUpdate and return the combined object.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023