Skip to content

EntityPrefab Class

Definition

Namespace: Brine2D.ECS

A reusable entity template that can be instantiated multiple times. Think of it like a "class" for entities.

C#
public class EntityPrefab

Inheritance System.Object → EntityPrefab

Fields
_componentConfigurators Component configuration actions \(called after component is added\).
Properties
Name Name of this prefab \(e\.g\., "Player", "Enemy", "Coin"\).
Tags Tags to apply to instantiated entities.
Methods
AddComponent<T>\(Action<T>\) Adds a component with a configuration action. The action is called after the component is added to configure its properties.
Instantiate\(IEntityWorld, Nullable<Vector2>\) Instantiates this prefab as a new entity.