feat: 支持音频管线
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { _decorator, Component, Prefab } from 'cc';
|
||||
import { _decorator, Component, Prefab, AudioClip } from 'cc';
|
||||
import { ViewManager } from './scripts/core/ViewManager';
|
||||
import { ToastManager } from './scripts/utils/ToastManager';
|
||||
import { AudioManager } from './scripts/utils/AudioManager';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,9 @@ export class main extends Component {
|
||||
@property({ type: Prefab, tooltip: 'Toast 预制体' })
|
||||
toastPrefab: Prefab | null = null;
|
||||
|
||||
@property({ type: AudioClip, tooltip: '通用按钮点击音效' })
|
||||
buttonClickAudio: AudioClip | null = null;
|
||||
|
||||
/**
|
||||
* onLoad 比 start 更早执行
|
||||
* 确保 ViewManager 在 PageLoading.start() 之前初始化
|
||||
@@ -109,5 +113,7 @@ export class main extends Component {
|
||||
if (this.toastPrefab) {
|
||||
ToastManager.instance.init(this.toastPrefab, this.node);
|
||||
}
|
||||
|
||||
AudioManager.instance.init(this.buttonClickAudio, this.node);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user