docs.unity.cn
    Show / Hide Table of Contents

    Cleanup shared components

    Cleanup shared components are managed shared components that have the destruction semantics of a cleanup component. They are useful to tag entities that require the same information for clean up.

    Create a cleanup shared component

    To create a cleanup shared component, create a struct that inherits from ICleanupSharedComponentData.

    The following code sample shows an empty system cleanup Component:

    public struct ExampleSharedCleanupComponent : ICleanupSharedComponentData
    {
        public int Value;
    }
    
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023