docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BakeDerivedTypesAttribute

    Attribute that informs the baking system that bakers of types derived from the current authoring component must be executed.

    Inheritance
    object
    Attribute
    BakeDerivedTypesAttribute
    Namespace: Unity.Entities
    Assembly: Unity.Entities.Hybrid.dll
    Syntax
    public class BakeDerivedTypesAttribute : Attribute
    Remarks

    Use this attribute on bakers which handle authoring components that can be specialized. In the example below, both the BaseBaker and the DerivedBaker are invoked when baking the DerivedAuthoring component.

    Examples
      class BaseAuthoring : MonoBehaviour { public int BaseValue; }
                  class DerivedAuthoring : BaseAuthoring { public float DerivedValue; }
    
                  [BakeDerivedTypes]
                  class BaseBaker : Baker<BaseAuthoring> { public override void Bake(BaseAuthoring authoring) { }
    
                  class DerivedBaker : Baker<DerivedAuthoring> { public override void Bake(DerivedAuthoring authoring) { }
    

    See Also

    Baker<TAuthoringType>
    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)