Interface: unit
Interface: unit
audio_.unit
安全音频单元
Table of contents
Properties
- init_b
- group_ns
- stop_group_n
- state
- wait_play_n
- total_time_s_n
- event
- type
- real_volume_n
- audio_source
- clip
- volume_n
- loop_b
- curr_time_s_n
- use_play_b
- wait_play_b
Methods
Properties
init_b
• Readonly
init_b: boolean
初始化状态
Defined in
assets/@framework/audio/mk_audio_base.ts:260
group_ns
• Readonly
group_ns: readonly number
[]
分组
Defined in
assets/@framework/audio/mk_audio_base.ts:262
stop_group_n
• Readonly
stop_group_n: null
| number
当前停止分组
Remarks
停止时优先级最大的分组
Defined in
assets/@framework/audio/mk_audio_base.ts:268
state
• Readonly
state: state
播放状态
Defined in
assets/@framework/audio/mk_audio_base.ts:270
wait_play_n
• Readonly
wait_play_n: number
等待播放次数
Remarks
0-n:等待播放次数
Defined in
assets/@framework/audio/mk_audio_base.ts:276
total_time_s_n
• Readonly
total_time_s_n: number
总时长
Remarks
单位秒
Defined in
assets/@framework/audio/mk_audio_base.ts:282
event
• Readonly
event: event_target
<event_protocol
>
事件对象
Defined in
assets/@framework/audio/mk_audio_base.ts:284
type
• Readonly
type: number
音频类型
Defined in
assets/@framework/audio/mk_audio_base.ts:286
real_volume_n
• Readonly
real_volume_n: number
真实音量
Defined in
assets/@framework/audio/mk_audio_base.ts:288
audio_source
• Readonly
audio_source: null
| AudioSource
音频组件
Remarks
common 使用
Defined in
assets/@framework/audio/mk_audio_base.ts:294
clip
• clip: null
| AudioClip
音频资源
Defined in
assets/@framework/audio/mk_audio_base.ts:296
volume_n
• volume_n: number
音量
Remarks
- common:use_play_b 为 false 的情况下修改只能在下次 play 时生效
Defined in
assets/@framework/audio/mk_audio_base.ts:302
loop_b
• loop_b: boolean
循环
Defined in
assets/@framework/audio/mk_audio_base.ts:304
curr_time_s_n
• curr_time_s_n: number
当前时间
Remarks
单位秒
Defined in
assets/@framework/audio/mk_audio_base.ts:310
use_play_b
• Optional
use_play_b: boolean
使用 play 接口,默认使用 playOneShot
Remarks
common 使用
play 接口存在最大并发数限制 cc.AudioSource.maxAudioChannel
playOneShot 接口不能暂停
Defined in
assets/@framework/audio/mk_audio_base.ts:320
wait_play_b
• Optional
wait_play_b: boolean
等待播放开关
Defined in
assets/@framework/audio/mk_audio_base.ts:322
Methods
clone
▸ clone<T
>(): T
克隆
Type parameters
Name | Type |
---|---|
T | extends unit |
Returns
T
Defined in
assets/@framework/audio/mk_audio_base.ts:325
▸ clone<T
>(value_n_
): T
[]
克隆
Type parameters
Name | Type |
---|---|
T | extends unit |
Parameters
Name | Type | Description |
---|---|---|
value_n_ | number | 克隆数量 |
Returns
T
[]