Skip to content

Game.EditorAssetCategoryOverride

Assembly:
Assembly-CSharp.dll

Namespace:
Game.Prefabs

Type:
Class

Base:
ComponentBase

Summary:
EditorAssetCategoryOverride is a Component used on prefab authoring objects in the editor to communicate include/exclude category overrides. If either m_IncludeCategories or m_ExcludeCategories is populated, the component will request that an EditorAssetCategoryOverrideData component be added to the entity representation of the prefab so runtime/editor systems can apply the include/exclude category filtering.


Fields

  • public string[] m_IncludeCategories
    Array of category identifiers to explicitly include for this prefab. When non-null and non-empty, the component signals that the prefab should carry include-category override data.

  • public string[] m_ExcludeCategories
    Array of category identifiers to explicitly exclude for this prefab. When non-null and non-empty, the component signals that the prefab should carry exclude-category override data.

Properties

  • This type does not declare any public properties.

Constructors

  • public EditorAssetCategoryOverride()
    Default constructor (compiler-provided). The component is typically instantiated by Unity (as a MonoBehaviour/Component asset on a prefab) rather than constructed manually in user code.

Methods

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Checks whether m_IncludeCategories or m_ExcludeCategories contain entries. If either array is non-null and non-empty, adds ComponentType.ReadWrite() to the provided components set so the prefab archetype will include that data component on the entity created for the prefab.

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    Empty override; this component does not add any archetype-level components via this method. The logic for adding the EditorAssetCategoryOverrideData is handled in GetPrefabComponents.

Usage Example

// Attach this component to a prefab in the editor and set categories in the inspector:
public class ExampleSetup
{
    void SetupPrefab(EditorAssetCategoryOverride overrideComp)
    {
        overrideComp.m_IncludeCategories = new[] { "Residential", "HighDensity" };
        overrideComp.m_ExcludeCategories = new[] { "NoTraffic" };
        // When the prefab is converted to an entity/prefab, the presence of these arrays
        // will cause EditorAssetCategoryOverrideData to be added so systems can read them.
    }
}