docs.unity.cn
    Show / Hide Table of Contents

    Cleanup components

    Cleanup components are like regular components, but when you destroy an entity that contains one, Unity removes all non-cleanup components instead. The entity still exists until you remove all cleanup components from it. This is useful to tag entities that require cleanup when destroyed.

    Topic Description
    Introducing cleanup components Understand cleanup components and their use cases.
    Create a cleanup component Create a new cleanup component to use in your application.
    Cleanup shared components Cleanup shared components are managed shared components that have the destruction semantics of a cleanup component.

    Additional resources

    • Shared components
    • Managed components
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023