docs.unity.cn
    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
    Syntax
    public class BakeDerivedTypesAttribute : Attribute, _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>
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, September 20, 2023