34 lines
697 B
TypeScript
34 lines
697 B
TypeScript
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class NewClass extends cc.Component {
|
|
|
|
@property(cc.Label)
|
|
label: cc.Label = null;
|
|
|
|
@property
|
|
text: string = 'hello';
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {}
|
|
|
|
start() {
|
|
|
|
}
|
|
|
|
//购买商品道具
|
|
buyProp(propName) {
|
|
// if(cc.fx.GameConfig.GM_INFO.coin < 1500){
|
|
// MiniGameSdk.API.showToast("金币不足,无法购买道具");
|
|
// return;
|
|
// }
|
|
// let propWindow = this.node.parent.parent.getChildByName("propWindow");
|
|
// propWindow.active = false;
|
|
// cc.fx.GameConfig.GM_INFO.coin -= 1500;
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|