fix(docs): fix MeshLoader constructor and Fence doc references
This commit is contained in:
36
docs/api/components/audio-source-component/set-volume.md
Normal file
36
docs/api/components/audio-source-component/set-volume.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# SetVolume
|
||||
|
||||
**所属类**: `AudioSourceComponent`
|
||||
|
||||
**头文件**: `XCEngine/Components/AudioSourceComponent.h`
|
||||
|
||||
**描述**: 设置音频源的音量。
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void SetVolume(float volume);
|
||||
```
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `volume` | `float` | 音量,范围 0.0 到 1.0 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/AudioSourceComponent.h>
|
||||
|
||||
using namespace XCEngine::Components;
|
||||
|
||||
void SetAudioVolume(AudioSourceComponent* source) {
|
||||
source->SetVolume(0.5f); // 50% 音量
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [AudioSourceComponent](./audio-source-component.md) - 音频源组件
|
||||
- [GetVolume](./get-volume.md) - 获取音量
|
||||
Reference in New Issue
Block a user