/**
 * 音效
 */
var speaker = cc.Class({
	extends: cc.Component,

	properties: {
		eff_btn: {
			default: null,
			type: cc.AudioClip,
			displayName: "点击音效"
		},
		eff_congratulation: {
			default: null,
			type: cc.AudioClip,
			displayName: "撒花音效"
		},
		eff_error: {
			default: null,
			type: cc.AudioClip,
			displayName: "点击错误音效"
		},
		eff_good: {
			default: null,
			type: cc.AudioClip,
			displayName: "点击正确音效"
		},
		eff_showPop: {
			default: null,
			type: cc.AudioClip,
			displayName: "显示弹窗音效"
		},
		eff_start: {
			default: null,
			type: cc.AudioClip,
			displayName: "游戏开始音效"
		},
		eff_open: {
			default: null,
			type: cc.AudioClip,
			displayName: "拉开窗帘"
		},
		eff_restart: {
			default: null,
			type: cc.AudioClip,
			displayName: "重新开始"
		},
	},

	ctor: function () {
		speaker.inst = this;
		g.speaker = speaker;
	},

	//点击按钮
	play_btn: function () {
		g.snd_mgr.playEffect(this.eff_btn);
	},

	//撒花音效
	play_congratulation: function () {
		g.snd_mgr.playEffect(this.eff_congratulation);
	},
	//答错
	play_error: function () {
		g.snd_mgr.playEffect(this.eff_error);
	},
	//答对
	play_good: function (cb) {
		g.snd_mgr.playEffect(this.eff_good, cb);
	},
	//显示弹窗
	play_showPop: function () {
		g.snd_mgr.playEffect(this.eff_showPop);
	},
	//游戏开始
	play_start: function (cb) {
		g.snd_mgr.playEffect(this.eff_start, cb);
	},

	//拉开窗帘
	play_open: function () {
		g.snd_mgr.playEffect(this.eff_open);
	},

	//重新开始
	play_restart: function () {
		g.snd_mgr.playEffect(this.eff_restart);
	},
});
