25 lines
647 B
Markdown
25 lines
647 B
Markdown
|
|
# ScriptEngine::OnScriptComponentEnabled
|
||
|
|
|
||
|
|
**命名空间**: `XCEngine::Scripting`
|
||
|
|
|
||
|
|
**类型**: `method`
|
||
|
|
|
||
|
|
**头文件**: `XCEngine/Scripting/ScriptEngine.h`
|
||
|
|
|
||
|
|
## 签名
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
void OnScriptComponentEnabled(ScriptComponent* component);
|
||
|
|
```
|
||
|
|
|
||
|
|
## 当前实现行为
|
||
|
|
|
||
|
|
- 只有运行时已启动且 `component` 非空时才处理。
|
||
|
|
- 会先把组件纳入跟踪表。
|
||
|
|
- 如果当前满足 `ShouldScriptRun()`,则立刻尝试 `EnsureScriptReady(..., true)`,从而补齐实例创建、`Awake` 和 `OnEnable`。
|
||
|
|
|
||
|
|
## 相关文档
|
||
|
|
|
||
|
|
- [OnScriptComponentDisabled](OnScriptComponentDisabled.md)
|
||
|
|
- [ScriptComponent::OnEnable](../ScriptComponent/OnEnable.md)
|