1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- cc.Class({
- extends: cc.Component,
- properties: {
- //交换时的音效
- swap:{
- default:null,
- type:cc.AudioClip
- },
- //点击时的音效
- click:{
- default:null,
- type: cc.AudioClip
- },
- //消除时的音效
- eliminate:{
- default:[],
- type:[cc.AudioClip]
- },
- //连消后的音效
- continuousMatch:{
- default:[],
- type:[cc.AudioClip]
- }
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- // start () {
- //
- // },
- playClick(){
- cc.audioEngine.play(this.click, false, 1);
- },
- playSwap(){
- cc.audioEngine.play(this.swap, false, 1);
- },
- playEliminate(step){
- step = Math.min(this.eliminate.length - 1, step);
- cc.audioEngine.play(this.eliminate[step], false, 1);
- },
- playContinuousMatch(step){
- // console.log("step = ",step);
- step = Math.min(step, 11);
- if (step < 2){
- return;
- }
- cc.audioEngine.play(this.continuousMatch[Math.floor(step / 2) - 1], false, 1);
- },
- // update (dt) {},
- });
|