Class ComponentSystemBaseManagedComponentExtensions | Entities | 0.2.0-preview.18
docs.unity.cn
    Show / Hide Table of Contents

    Class ComponentSystemBaseManagedComponentExtensions

    Inheritance
    Object
    ComponentSystemBaseManagedComponentExtensions
    Namespace: Unity.Entities
    Syntax
    public static class ComponentSystemBaseManagedComponentExtensions

    Methods

    GetSingleton<T>(ComponentSystemBase)

    Gets the value of a singleton component.

    Declaration
    public static T GetSingleton<T>(this ComponentSystemBase sys)
        where T : class, IComponentData
    Parameters
    Type Name Description
    ComponentSystemBase sys
    Returns
    Type Description
    T

    The component.

    Type Parameters
    Name Description
    T

    The IComponentData subtype of the singleton component.

    See Also
    GetSingleton<T>()

    HasSingleton<T>(ComponentSystemBase)

    Checks whether a singelton component of the specified type exists.

    Declaration
    public static bool HasSingleton<T>(this ComponentSystemBase sys)
        where T : class, IComponentData
    Parameters
    Type Name Description
    ComponentSystemBase sys
    Returns
    Type Description
    Boolean

    True, if a singleton of the specified type exists in the current World.

    Type Parameters
    Name Description
    T

    The IComponentData subtype of the singleton component.

    SetSingleton<T>(ComponentSystemBase, T)

    Sets the value of a singleton component.

    Declaration
    public static void SetSingleton<T>(this ComponentSystemBase sys, T value)
        where T : class, IComponentData
    Parameters
    Type Name Description
    ComponentSystemBase sys
    T value

    A component containing the value to assign to the singleton.

    Type Parameters
    Name Description
    T

    The IComponentData subtype of the singleton component.

    See Also
    SetSingleton<T>(T)
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX