docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetOrCreateSystem

    GetOrCreateSystem<T>()

    Retrieve the handle for the instance of a system of type T from the current World. If the system does not exist in this World, it will first be created.

    Declaration
    public SystemHandle GetOrCreateSystem<T>() where T : ComponentSystemBase
    Returns
    Type Description
    SystemHandle

    The handle for the instance of system type T in this World. If the system does not exist in this World, it will first be created.

    Type Parameters
    Name Description
    T

    The system type

    Remarks

    Important: This function creates a sync point if a system is created, which means that the EntityManager waits for all currently running Jobs to complete before creating the system, and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    GetOrCreateSystem(Type)

    Retrieve the handle for the instance of a system of type type from the current World. If the system does not exist in this World, it will first be created.

    Declaration
    public SystemHandle GetOrCreateSystem(Type type)
    Parameters
    Type Name Description
    Type type

    The system type

    Returns
    Type Description
    SystemHandle

    The handle for the instance of system type type in this World. If the system does not exist in this World, it will first be created.

    Remarks

    Important: This function creates a sync point if a system is created, which means that the EntityManager waits for all currently running Jobs to complete before creating the system, and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    GetOrCreateSystem(SystemTypeIndex)

    Retrieve the handle for the instance of a system of type type from the current World. If the system does not exist in this World, it will first be created.

    Declaration
    public SystemHandle GetOrCreateSystem(SystemTypeIndex type)
    Parameters
    Type Name Description
    SystemTypeIndex type

    The system type

    Returns
    Type Description
    SystemHandle

    The handle for the instance of system type type in this World. If the system does not exist in this World, it will first be created.

    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)