Entitas  0.40.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Public Member Functions | Protected Member Functions | List of all members
Entitas.ReactiveSystem< TEntity > Class Template Referenceabstract
Inheritance diagram for Entitas.ReactiveSystem< TEntity >:
Entitas.IReactiveSystem Entitas.IExecuteSystem Entitas.ISystem

Public Member Functions

void Activate ()
 
void Deactivate ()
 
void Clear ()
 Clears all accumulated changes.
 
void Execute ()
 
override string ToString ()
 

Protected Member Functions

 ReactiveSystem (IContext< TEntity > context)
 
 ReactiveSystem (Collector< TEntity > collector)
 
abstract Collector< TEntity > GetTrigger (IContext< TEntity > context)
 Specify the collector that will trigger the ReactiveSystem.
 
abstract bool Filter (TEntity entity)
 This will exclude all entities which don't pass the filter.
 
abstract void Execute (List< TEntity > entities)
 

Detailed Description

A ReactiveSystem calls Execute(entities) if there were changes based on the specified Collector and will only pass in changed entities. A common use-case is to react to changes, e.g. a change of the position of an entity to update the gameObject.transform.position of the related gameObject.

Type Constraints
TEntity :class 
TEntity :IEntity 
TEntity :new() 

Definition at line 10 of file ReactiveSystem.cs.

Member Function Documentation

◆ Activate()

void Entitas.ReactiveSystem< TEntity >.Activate ( )
inline

Activates the ReactiveSystem and starts observing changes based on the specified Collector. ReactiveSystem are activated by default.

Implements Entitas.IReactiveSystem.

Definition at line 37 of file ReactiveSystem.cs.

◆ Deactivate()

void Entitas.ReactiveSystem< TEntity >.Deactivate ( )
inline

Deactivates the ReactiveSystem. No changes will be tracked while deactivated. This will also clear the ReactiveSystem. ReactiveSystem are activated by default.

Implements Entitas.IReactiveSystem.

Definition at line 45 of file ReactiveSystem.cs.

◆ Execute()

void Entitas.ReactiveSystem< TEntity >.Execute ( )
inline

Will call Execute(entities) with changed entities if there are any. Otherwise it will not call Execute(entities).

Implements Entitas.IExecuteSystem.

Definition at line 56 of file ReactiveSystem.cs.


The documentation for this class was generated from the following file: