pinball/assets/_Game/Scripts/UI/ButonSound.ts

18 lines
527 B
TypeScript
Raw Normal View History

2024-04-03 02:43:18 -07:00
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;
}
}