var EventListener = require("./EventListener") var global = require("./global") cc.Class({ extends: cc.Component, properties: { }, onLoad() { global.eventlistener = EventListener({}); global.eventlistener.on("login",function(data){ console.log("btn_click_uid:"+uid); //向服务器发送login 消息 }); }, start() { }, // update (dt) {}, });
import global from "./global"; cc.Class({ extends: cc.Component, properties: { input_name: { default: null, type: cc.EditBox } }, onLoad() { }, start() { }, btnClick(event, data) { if (data == "login") { // global.eventlistener.fire("login",this.input_name.string); } } //update (dt) {}, });
站长微信:xiaomao0055
站长QQ:14496453