跳至主要內容

Interface: unit

muzzik大约 2 分钟

index / audio_ / unit

Interface: unit

audio_.unit

安全音频单元

Table of contents

Properties

Methods

Properties

init_b

Readonly init_b: boolean

初始化状态

Defined in

assets/@framework/audio/mk_audio_base.ts:260open in new window


group_ns

Readonly group_ns: readonly number[]

分组

Defined in

assets/@framework/audio/mk_audio_base.ts:262open in new window


stop_group_n

Readonly stop_group_n: null | number

当前停止分组

Remarks

停止时优先级最大的分组

Defined in

assets/@framework/audio/mk_audio_base.ts:268open in new window


state

Readonly state: state

播放状态

Defined in

assets/@framework/audio/mk_audio_base.ts:270open in new window


wait_play_n

Readonly wait_play_n: number

等待播放次数

Remarks

0-n:等待播放次数

Defined in

assets/@framework/audio/mk_audio_base.ts:276open in new window


total_time_s_n

Readonly total_time_s_n: number

总时长

Remarks

单位秒

Defined in

assets/@framework/audio/mk_audio_base.ts:282open in new window


event

Readonly event: event_target<event_protocol>

事件对象

Defined in

assets/@framework/audio/mk_audio_base.ts:284open in new window


type

Readonly type: number

音频类型

Defined in

assets/@framework/audio/mk_audio_base.ts:286open in new window


real_volume_n

Readonly real_volume_n: number

真实音量

Defined in

assets/@framework/audio/mk_audio_base.ts:288open in new window


audio_source

Readonly audio_source: null | AudioSource

音频组件

Remarks

common 使用

Defined in

assets/@framework/audio/mk_audio_base.ts:294open in new window


clip

clip: null | AudioClip

音频资源

Defined in

assets/@framework/audio/mk_audio_base.ts:296open in new window


volume_n

volume_n: number

音量

Remarks

  • common:use_play_b 为 false 的情况下修改只能在下次 play 时生效

Defined in

assets/@framework/audio/mk_audio_base.ts:302open in new window


loop_b

loop_b: boolean

循环

Defined in

assets/@framework/audio/mk_audio_base.ts:304open in new window


curr_time_s_n

curr_time_s_n: number

当前时间

Remarks

单位秒

Defined in

assets/@framework/audio/mk_audio_base.ts:310open in new window


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:320open in new window


wait_play_b

Optional wait_play_b: boolean

等待播放开关

Defined in

assets/@framework/audio/mk_audio_base.ts:322open in new window

Methods

clone

clone<T>(): T

克隆

Type parameters

NameType
Textends unit

Returns

T

Defined in

assets/@framework/audio/mk_audio_base.ts:325open in new window

clone<T>(value_n_): T[]

克隆

Type parameters

NameType
Textends unit

Parameters

NameTypeDescription
value_n_number克隆数量

Returns

T[]

Defined in

assets/@framework/audio/mk_audio_base.ts:330open in new window

📣 觉得很赞?分享给你的朋友吧!