docs: expand gameobject helper docs
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
# GameObject::IsActive
|
||||
|
||||
查询当前状态。
|
||||
返回对象自身的 `activeSelf` 状态。
|
||||
|
||||
```cpp
|
||||
bool IsActive() const;
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Components/GameObject.h`,当前页面用于固定 `GameObject` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:** 无。
|
||||
这个接口只读 `m_activeSelf`,不考虑父对象状态。
|
||||
|
||||
**返回:** `bool` - 返回值语义详见头文件声明。
|
||||
因此:
|
||||
|
||||
**示例:**
|
||||
- 返回 `true` 不代表对象一定在运行
|
||||
- 只要父链中有对象失活,[IsActiveInHierarchy](IsActiveInHierarchy.md) 仍可能返回 `false`
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/GameObject.h>
|
||||
## 返回值
|
||||
|
||||
void Example() {
|
||||
XCEngine::Components::GameObject object;
|
||||
// 根据上下文补齐参数后调用 GameObject::IsActive(...)。
|
||||
(void)object;
|
||||
}
|
||||
```
|
||||
- `true` - 对象自身处于激活状态。
|
||||
- `false` - 对象自身被显式关闭。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](GameObject.md)
|
||||
- [返回模块目录](../Components.md)
|
||||
- [SetActive](SetActive.md)
|
||||
- [IsActiveInHierarchy](IsActiveInHierarchy.md)
|
||||
|
||||
Reference in New Issue
Block a user