Skip to content

Game.Prefabs.ChirperAccount

Assembly:
Namespace: Game.Prefabs

Type: class

Base: PrefabBase

Summary:
Represents a prefab wrapper for a "Chirper" account in the game's prefab system. Holds a reference to an InfoviewPrefab used to display chirper information and ensures the corresponding ECS component (ChirperAccountData) is registered on the prefab so ECS systems can query and use it.


Fields

  • public InfoviewPrefab m_InfoView
    Reference to an InfoviewPrefab used by this Chirper account prefab (likely a visual/info UI prefab). This is a public field that can be assigned in the prefab asset or by code.

Properties

  • This class does not declare any properties.

Constructors

  • public ChirperAccount()
    No explicit constructor is defined in the source; the default parameterless constructor is used.

Methods

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Overrides PrefabBase.GetPrefabComponents to add the ECS component required by this prefab. The method calls base.GetPrefabComponents(components) and then adds ComponentType.ReadWrite() so that entities created from this prefab will include a mutable ChirperAccountData component.

Notes: - ComponentType.ReadWrite() indicates the component will be added with read/write access in the Entities package. - ChirperAccountData must be defined elsewhere as an IComponentData or compatible ECS component type.

Usage Example

public class ChirperAccount : PrefabBase
{
    public InfoviewPrefab m_InfoView;

    public override void GetPrefabComponents(HashSet<ComponentType> components)
    {
        base.GetPrefabComponents(components);
        components.Add(ComponentType.ReadWrite<ChirperAccountData>());
    }
}

Additional example usage (when creating or inspecting prefab components):

var components = new HashSet<ComponentType>();
chirperPrefab.GetPrefabComponents(components);
// components now contains ChirperAccountData (read/write), plus any base prefab components

{{ Add or assign m_InfoView in the prefab asset inspector or by code. Ensure ChirperAccountData is implemented as an ECS component (IComponentData) so systems can process chirper accounts. }}