docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetSharedComponent

    SetSharedComponent<T>(Entity, in T)

    Replaces the value of the shared component on the Entity.

    Declaration
    public void SetSharedComponent<T>(Entity entity, in T component) where T : unmanaged, ISharedComponentData
    Parameters
    Type Name Description
    Entity entity

    The Entity to set the component to

    T component

    The component to set

    Type Parameters
    Name Description
    T

    The type of component to set

    Remarks

    This method can only be invoked if the same baker instance previously added this specific component. This is not a very common operation in bakers, but sometimes you have utility methods that add the relevant components and initialize them to a reasonable default state for that utility method, but then your baker needs to override the value of one of those added components to something specific in your particular baker.

    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)