{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Tag components | Entities | 1.2.0-exp.3
docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Tag components

    Tag components are unmanaged components that store no data and take up no space.

    Conceptually, tag components fulfil a similar purpose to GameObject tags and they're useful in queries because you can filter entities by whether they have a tag component. For example, you can use them alongside cleanup components and filter entities to perform cleanup.

    Create a tag component

    To create a tag component, create an unmanaged component without any properties.

    The following code sample shows a tag component:

    public struct ExampleTagComponent : IComponentData
    {
    
    }
    

    Additional resources

    • Unmanaged components
    • Cleanup components
    In This Article
    Back to top
    Copyright © 2023 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)