class

Entitas::MultiReactiveSystem

Inherits Entitas::Systems::ReactiveSystem / Entitas::Systems::ExecuteSystem / Entitas::System / Entitas::System / Reference / Object

A Entitas::ReactiveSystem calls Execute(entities) if there were changes based on the specified Entitas::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.

Constants

Log = ::Log.for(self)

Constructors

new(collectors : Array(ICollector), filter : Proc(IEntity, Bool))
Source
new(context : Entitas::Context, filter : Proc(IEntity, Bool))
Source
new(collectors : Array(ICollector))
Source
new(contexts : ::Contexts)
Source

Instance methods

activate

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

Source
clear

Clears all accumulated changes.

Source
clear_collected_entities

Alias. See #clear

Source
deactivate

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

Source
execute(entities : Array(IEntity))
Source
execute
Source
filter(entity)

This will exclude all entities which don't pass the filter.

Source
get_trigger(contexts : ::Contexts) : Array(ICollector)

Specify the collector that will trigger the ReactiveSystem.

Source
to_s(io)
Source