Files
XCEngine/docs/api/components/light-component/get-spot-angle.md
ssdfasd 10ee1fa3fa docs: 更新 audioclip 和 audio-source-component 文档
- audioclip: 新增 set 方法文档
- audio-source-component: 新增 set-output-mixer 文档
2026-03-26 02:04:27 +08:00

38 lines
724 B
Markdown

# GetSpotAngle
**所属类**: `LightComponent`
**头文件**: `XCEngine/Components/LightComponent.h`
**描述**: 获取聚光灯的角度(仅对聚光灯有效)。
## 函数签名
```cpp
float GetSpotAngle() const;
```
## 返回值
| 类型 | 描述 |
|------|------|
| `float` | 聚光灯角度(度),默认值为 30.0 |
## 使用示例
```cpp
#include <XCEngine/Components/LightComponent.h>
using namespace XCEngine::Components;
void PrintSpotAngle(LightComponent* light) {
float angle = light->GetSpotAngle();
printf("Spot angle: %.1f degrees\n", angle);
}
```
## 相关文档
- [LightComponent](light-component.md) - 光源组件
- [SetSpotAngle](set-spot-angle.md) - 设置聚光灯角度