docs: expand gameobject helper docs
This commit is contained in:
@@ -1,31 +1,25 @@
|
||||
# GameObject::Update
|
||||
|
||||
更新运行时状态。
|
||||
向当前对象及其子树分发逐帧 `Update(deltaTime)`。
|
||||
|
||||
```cpp
|
||||
void Update(float deltaTime);
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Components/GameObject.h`,当前页面用于固定 `GameObject` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `deltaTime` - 参数语义详见头文件声明。
|
||||
当前实现会:
|
||||
|
||||
**返回:** `void` - 无返回值。
|
||||
- 若对象不处于 `active in hierarchy`,直接返回
|
||||
- 对所有已启用普通组件调用 `Update(deltaTime)`
|
||||
- 递归对子对象调用 `Update(deltaTime)`
|
||||
|
||||
**示例:**
|
||||
## 参数
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/GameObject.h>
|
||||
|
||||
void Example() {
|
||||
XCEngine::Components::GameObject object;
|
||||
// 根据上下文补齐参数后调用 GameObject::Update(...)。
|
||||
(void)object;
|
||||
}
|
||||
```
|
||||
- `deltaTime` - 当前变步长帧时间。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](GameObject.md)
|
||||
- [返回模块目录](../Components.md)
|
||||
- [Start](Start.md)
|
||||
- [FixedUpdate](FixedUpdate.md)
|
||||
- [LateUpdate](LateUpdate.md)
|
||||
|
||||
Reference in New Issue
Block a user