Contents

SushiEngine::Simulation::IWorldEditor

set_enabled

virtual void set_enabled(EntityId id, bool enabled)=0

Parameters

NameType
idEntityId
enabledbool

Description

Sets the entity's own flag (Unity's activeSelf).

Example

void on_message(SushiEngine::Simulation::IWorldEditor& world,
                SushiEngine::Simulation::EntityId self,
                SushiEngine::Simulation::EntityId sender,
                const std::string& name,
                const SushiEngine::Simulation::ScriptField& payload) override
{
    if (name == "TurnOff")
        world.set_enabled(self, false);
}