# ScriptEngine::OnScriptComponentDisabled **命名空间**: `XCEngine::Scripting` **类型**: `method` **头文件**: `XCEngine/Scripting/ScriptEngine.h` ## 签名 ```cpp void OnScriptComponentDisabled(ScriptComponent* component); ``` ## 当前实现行为 - 只有运行时已启动、组件存在且当前状态 `enabled == true` 时才继续。 - 调用 `OnDisable` 生命周期。 - 然后把 `state.enabled` 置为 `false`。 ## 相关文档 - [OnScriptComponentEnabled](OnScriptComponentEnabled.md) - [OnScriptComponentDestroyed](OnScriptComponentDestroyed.md)