Contents

class

SushiEngine::Simulation::IEntityBehavior

Native counterpart of a ScriptComponent — one live instance per (EntityId, type_name) pair while the simulation is playing.

Declared in
engine/world/simulation/include/SushiEngine/simulation/entity_behavior.hpp

Every method has an empty default body: a behavior overrides only the hooks it cares about, exactly like Unity's MonoBehaviour.

Public Methods

~IEntityBehavior

Messages

on_spawn

Runs once, when this instance first exists: at the start of Play, or when add_script_component attaches the script during Play.

on_enable

Runs after on_spawn on a hierarchy-enabled entity, and each time the entity becomes hierarchy-enabled again.

on_disable

Runs each time the entity stops being hierarchy-enabled.

on_destroy

Runs once, before the instance is torn down: at Stop, when the entity is destroyed, or when its ScriptComponent is removed.

on_update

Runs once per fixed step while playing, on each hierarchy-enabled entity.

on_message

Runs when IWorldEditor::send_message targets this behavior's entity; a behavior that does not recognize name does nothing.