4ff93a40-06e6-4598-a0a3-553bc81c84c6.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. "use strict";
  2. cc._RF.push(module, '4ff93pABuZFmKCjVTvIHITG', 'HelpNode');
  3. // Texture/prefab/HelpNode.js
  4. "use strict";
  5. var ZYGameTool = require('GameTool');
  6. var gameHelp = cc.Class({
  7. "extends": cc.Component,
  8. properties: {
  9. btn: {
  10. title: "按钮",
  11. type: cc.Node,
  12. "default": []
  13. },
  14. btnCallFunc: null,
  15. isClose: true
  16. },
  17. // LIFE-CYCLE CALLBACKS:
  18. setParam: function setParam(param) {
  19. this.isClose = param;
  20. cc.log("param", param);
  21. },
  22. onLoad: function onLoad() {
  23. this.node.on(cc.Node.EventType.TOUCH_START, this.touchBegin.bind(this), this);
  24. if (!Module.GameHelpLayer) Module.GameHelpLayer = this;
  25. for (var i in this.btn) {
  26. this.btn[i].on('click', function (event) {
  27. this.node.destroy();
  28. Module.GameHelpLayer = null;
  29. console.log("------click", event.node.name);
  30. if (this.btnCallFunc) this.btnCallFunc(event.node.name);
  31. }.bind(this));
  32. }
  33. ZYGameTool.getInstance().OpenAd("banner", "banner");
  34. },
  35. start: function start() {},
  36. call: function call(func) {
  37. this.btnCallFunc = func;
  38. },
  39. touchBegin: function touchBegin(touch, event) {
  40. if (!this.isClose) return;
  41. this.node.destroy();
  42. } // update (dt) {},
  43. });
  44. cc._RF.pop();