2d60ab8e-1e22-4140-9bb7-09e94a8df395.js 1.1 KB

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