import { AudioConst } from "../data/const/TypeConst";
import GameDataCenter from "../data/GameDataCenter";

/**
 * 指定方法执行时播放的音效
 * @param effect 音效
 */
export default function ClickAuEffect(effect: AudioConst = AudioConst.effect_click) {
	return function (target: any, keyname: string, descriptor: PropertyDescriptor) {
		const method: Function = descriptor.value;
		descriptor.value = function (...args: any[]) {
			GameDataCenter.audio.playEffect(effect);
			return method.apply(this, args);
		};
	};
}
