12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- cc.Class({
- extends: cc.Component,
- properties: {
- hitWood: {
- default: null,
- url: cc.AudioClip
- },
- hitKnife: {
- default: null,
- url: cc.AudioClip
- },
- hitCoin: {
- default: null,
- url: cc.AudioClip
- },
- readyGo: {
- default: null,
- url: cc.AudioClip
- }
- },
- _playSFX: function(clip) {
- cc.audioEngine.playEffect( clip, false );
- },
- /**
- * 击中木块
- */
- playHitWood () {
- this._playSFX(this.hitWood)
- },
- /**
- * 击中刀
- */
- playKnife () {
- this._playSFX(this.hitKnife)
- },
- /**
- * 击中金币
- */
- playKnife () {
- this._playSFX(this.hitCoin)
- },
- playReadyGo () {
- this._playSFX(this.readyGo)
- }
- });
|