33 lines
854 B
TypeScript
33 lines
854 B
TypeScript
// Learn TypeScript:
|
|
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.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
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class NewClass extends cc.Component {
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {}
|
|
|
|
start () {
|
|
let GameManager = this.node.parent.parent.parent.getComponent("GameManager");
|
|
|
|
if(GameManager.bgClick == true){
|
|
GameManager.bgClick = false;
|
|
this.node.on(cc.Node.EventType.TOUCH_START, this.onClick, this);
|
|
}
|
|
|
|
}
|
|
|
|
onClick(){
|
|
cc.fx.Notifications.emit(cc.fx.Message.guideNext);
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|