Skip to content

Game.Prefabs.BrushData

Assembly: Assembly-CSharp (typical Unity build; may vary by project)
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
BrushData is a plain ECS component that carries configuration for a "brush" used by prefab/painting systems. It stores an EntityArchetype describing the archetype used when creating entities from the brush, a priority integer for ordering, and an int2 resolution describing the brush grid or texture resolution.


Fields

  • public Unity.Entities.EntityArchetype m_Archetype
    Holds the EntityArchetype associated with this brush. Used when instantiating entities that match the brush's component layout.

  • public int m_Priority
    Integer priority value for the brush. Can be used by systems to sort or choose between multiple brushes (higher = higher priority, subject to system interpretation).

  • public Unity.Mathematics.int2 m_Resolution
    Resolution of the brush in X/Y (for example, grid size or texture resolution). Stored as an int2 from Unity.Mathematics.

Properties

  • This type does not define any properties. It exposes three public fields.

Constructors

  • public BrushData()
    The default parameterless constructor is provided implicitly by the C# compiler. Fields will have default values (m_Archetype = default, m_Priority = 0, m_Resolution = int2(0,0)). Initialize fields explicitly when creating instances.

Methods

  • This type does not define any methods. It is a plain data-only ECS component.

Usage Example

using Unity.Entities;
using Unity.Mathematics;
using Game.Prefabs;

// Example: creating a BrushData and adding it to an entity
void CreateBrush(EntityManager entityManager, Entity brushEntity)
{
    // Create an archetype appropriate for your brush-created entities
    var createdArchetype = entityManager.CreateArchetype(
        typeof(SomeComponent),
        typeof(AnotherComponent)
    );

    var brush = new BrushData
    {
        m_Archetype = createdArchetype,
        m_Priority = 10,
        m_Resolution = new int2(64, 64)
    };

    // Add the BrushData component to an existing brush entity
    entityManager.AddComponentData(brushEntity, brush);
}

Notes: - Because BrushData implements IComponentData, it can be added to entities via EntityManager or used in Archetypes/Chunks. - Implementing IQueryTypeParameter indicates this type may be usable with certain ECS query APIs as a type parameter; consult your ECS version's docs for specifics.