18 lines
527 B
TypeScript
18 lines
527 B
TypeScript
import { _decorator, Button, Component, Node } from 'cc';
|
|
import { SoundManager } from '../Manager/SoundManager';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('ButonSound')
|
|
export class ButonSound extends Component {
|
|
@property({ type: Node, visible: true })
|
|
private _unMute: Node;
|
|
@property({ type: Node, visible: true })
|
|
private _mute: Node;
|
|
|
|
public clickBtn() {
|
|
const mute = SoundManager.instance.toggleMute();
|
|
this._mute.active = mute;
|
|
this._unMute.active = !mute;
|
|
}
|
|
}
|