Class: _unit
Class: _unit
audio_._unit
音频单元
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new _unit(init_?
)
Parameters
Name | Type |
---|---|
init_? | Partial <_unit > |
Defined in
assets/@framework/audio/mk_audio_base.ts:382
Properties
clip
• clip: null
| AudioClip
= null
音频资源
Defined in
assets/@framework/audio/mk_audio_base.ts:389
type
• type: type
= global_config.audio.type.effect
音频类型
Defined in
assets/@framework/audio/mk_audio_base.ts:393
_event
• Optional
_event: event_target
<event_protocol
>
事件对象
Defined in
assets/@framework/audio/mk_audio_base.ts:397
group_ns
• group_ns: number
[] = []
分组
Defined in
assets/@framework/audio/mk_audio_base.ts:399
stop_group_n
• stop_group_n: null
| number
= null
当前停止分组
Remarks
停止时优先级最大的分组
Defined in
assets/@framework/audio/mk_audio_base.ts:405
state
• state: state
= state.stop
播放状态
Defined in
assets/@framework/audio/mk_audio_base.ts:407
wait_play_n
• wait_play_n: number
= -1
等待播放次数
Remarks
-1:关闭,0-n:等待播放次数
Defined in
assets/@framework/audio/mk_audio_base.ts:413
real_volume_n
• real_volume_n: number
= 0
真实音量
Defined in
assets/@framework/audio/mk_audio_base.ts:415
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:425
_init_b
• Protected
_init_b: boolean
= false
初始化状态
Defined in
assets/@framework/audio/mk_audio_base.ts:502
Accessors
init_b
• get
init_b(): boolean
初始化状态
Returns
boolean
Defined in
assets/@framework/audio/mk_audio_base.ts:428
• set
init_b(value_b_
): void
Parameters
Name | Type |
---|---|
value_b_ | boolean |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:432
volume_n
• get
volume_n(): number
音量
Returns
number
Remarks
- common:use_play_b 为 false 的情况下修改只能在下次 play 时生效
Defined in
assets/@framework/audio/mk_audio_base.ts:442
• set
volume_n(value_n_
): void
Parameters
Name | Type |
---|---|
value_n_ | number |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:446
loop_b
• get
loop_b(): boolean
循环
Returns
boolean
Defined in
assets/@framework/audio/mk_audio_base.ts:451
• set
loop_b(value_b_
): void
Parameters
Name | Type |
---|---|
value_b_ | boolean |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:455
total_time_s_n
• get
total_time_s_n(): number
总时长(秒)
Returns
number
Defined in
assets/@framework/audio/mk_audio_base.ts:460
curr_time_s_n
• get
curr_time_s_n(): number
当前时间(秒)
Returns
number
Defined in
assets/@framework/audio/mk_audio_base.ts:465
• set
curr_time_s_n(value_n_
): void
Parameters
Name | Type |
---|---|
value_n_ | number |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:469
event
• get
event(): event_target
<event_protocol
>
事件对象
Returns
event_target
<event_protocol
>
Defined in
assets/@framework/audio/mk_audio_base.ts:474
wait_play_b
• get
wait_play_b(): boolean
等待播放开关
Returns
boolean
Defined in
assets/@framework/audio/mk_audio_base.ts:479
• set
wait_play_b(value_b_
): void
Parameters
Name | Type |
---|---|
value_b_ | boolean |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:483
audio_source
• get
audio_source(): null
| AudioSource
音频组件
Returns
null
| AudioSource
Remarks
common 使用
Defined in
assets/@framework/audio/mk_audio_base.ts:492
• set
audio_source(value_
): void
Parameters
Name | Type |
---|---|
value_ | null | AudioSource |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:496
Methods
update_volume
▸ Abstract
update_volume(): void
更新音量
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:505
_clone
▸ Protected
Abstract
_clone(): _unit
克隆
Returns
Defined in
assets/@framework/audio/mk_audio_base.ts:507
clone
▸ clone(): _unit
克隆
Returns
Defined in
assets/@framework/audio/mk_audio_base.ts:510
▸ clone(value_n_
): _unit
[]
克隆
Parameters
Name | Type | Description |
---|---|---|
value_n_ | number | 克隆数量 |
Returns
_unit
[]