docs.unity3d.com
Search Results for

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