RequiresAttribute

Namespace: Bang.Components
Assembly: Bang.dll

public class RequiresAttribute : Attribute

Marks a component as requiring other components when being added to an entity. This is an attribute that tells that a given data requires another one of the same type. For example: a component requires another component when adding it to the entity, or a system requires another system when adding it to a world. If this is for a system, it assumes that the system that depends on the other one comes first.

Implements: Attribute

⭐ Constructors

public RequiresAttribute(Type[] types)

Creates a new RequiresAttribute.

Parameters
types Type[]

⭐ Properties

TypeId

public virtual Object TypeId { get; }

Returns
Object

Types

public Type[] Types { get; public set; }

System will target all entities that have this set of components.

Returns
Type[]