12345678910111213141516171819202122232425262728293031323334 |
- // Learn cc.Class:
- // - https://docs.cocos.com/creator/manual/en/scripting/class.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
- cc.Class({
- extends: cc.Component,
- properties: {
- toast: cc.Label,
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad() {
- this.node.on('click',this.loadpk,this);
- },
- loadpk() {
- MyAudio.PlayEffect_button();
- if (!Global.endinit) {
- Global.toast("请等待汽车加载完成!")
- return;
- }
- if (Global.MaxCarLevel == 0) {
- //提示先创建车辆
- Global.toast('请先购买至少一辆车');
- return
- }
- // Global.CocosAnalysticCustomEvent('PK', 'Jump')
- cc.director.loadScene("pk")
- }
- // update (dt) {},
- });
|