docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Create a chunk component

    A chunk component's definition is the same as an unmanaged component. This means that you create a regular struct that inherits from IComponentData to create a chunk component. The difference between chunk components and unmanaged components is how you add them to an entity.

    The following code sample shows an unmanaged component:

    public struct ExampleChunkComponent : IComponentData
    {
        public int Value;
    }
    

    To use the unmanaged component as a chunk component, use EntityManager.AddChunkComponentData<YourChunkComponent>(Entity) to add it to an entity.

    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)