Files
XCEngine/docs/api/XCEngine/Components/GameObject/GetTransform.md

864 B

GameObject::GetTransform

获取相关状态或对象。

该方法在 XCEngine/Components/GameObject.h 中提供了 2 个重载,当前页面统一汇总这些公开声明。

重载 1: 声明

TransformComponent* GetTransform();

参数: 无。

返回: TransformComponent* - 返回值语义详见头文件声明。

重载 2: 声明

const TransformComponent* GetTransform() const;

参数: 无。

返回: const TransformComponent* - 返回值语义详见头文件声明。

示例:

#include <XCEngine/Components/GameObject.h>

void Example() {
    XCEngine::Components::GameObject object;
    // 根据上下文补齐参数后调用 GameObject::GetTransform(...)。
    (void)object;
}

相关文档