docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Cleanup shared components

    Cleanup shared components are 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;
    }
    
    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)