docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetOrCreateSystem

    GetOrCreateSystem<T>(World)

    Retrieve the handle for an 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 static SystemHandle GetOrCreateSystem<T>(this World self) where T : unmanaged, ISystem
    Parameters
    Type Name Description
    World self

    The World

    Returns
    Type Description
    SystemHandle

    The instance's handle 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.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the system type Thas not been registered with the TypeManager.

    GetOrCreateSystem(World, Type)

    Obsolete. Use GetOrCreateSystem(Type) instead.

    Declaration
    [Obsolete("Use World.GetOrCreateSystem instead")]
    public static SystemHandle GetOrCreateSystem(World self, Type unmanagedType)
    Parameters
    Type Name Description
    World self

    The World

    Type unmanagedType

    The type.

    Returns
    Type Description
    SystemHandle
    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)