85fd69e1a920288617adf1b8791df9dbe36d4a4c.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, ecs, CCComp, Label, oops, _dec, _dec2, _class, _crd, ccclass, property, DemoViewComp;
  4. function _reportPossibleCrUseOfecs(extras) {
  5. _reporterNs.report("ecs", "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS", _context.meta, extras);
  6. }
  7. function _reportPossibleCrUseOfCCComp(extras) {
  8. _reporterNs.report("CCComp", "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfoops(extras) {
  11. _reporterNs.report("oops", "db://oops-framework/core/Oops", _context.meta, extras);
  12. }
  13. return {
  14. setters: [function (_unresolved_) {
  15. _reporterNs = _unresolved_;
  16. }, function (_cc) {
  17. _cclegacy = _cc.cclegacy;
  18. __checkObsolete__ = _cc.__checkObsolete__;
  19. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  20. _decorator = _cc._decorator;
  21. Label = _cc.Label;
  22. }, function (_unresolved_2) {
  23. ecs = _unresolved_2.ecs;
  24. }, function (_unresolved_3) {
  25. CCComp = _unresolved_3.CCComp;
  26. }, function (_unresolved_4) {
  27. oops = _unresolved_4.oops;
  28. }],
  29. execute: function () {
  30. _crd = true;
  31. _cclegacy._RF.push({}, "78b5dVjj81IxoHGx2PAK8bT", "DemoViewComp", undefined);
  32. /*
  33. * @Author: mojunshou 1637302775@qq.com
  34. * @Date: 2025-02-26 17:11:55
  35. * @LastEditors: mojunshou 1637302775@qq.com
  36. * @LastEditTime: 2025-03-11 17:21:52
  37. * @FilePath: \Cocos_android\assets\script\game\account\view\DemoViewComp.ts
  38. * @Description: DemoView场景文件
  39. */
  40. __checkObsolete__(['_decorator']);
  41. __checkObsolete__(['Label']);
  42. __checkObsolete__(['EventTouch']);
  43. ({
  44. ccclass,
  45. property
  46. } = _decorator);
  47. /** 视图层对象 */
  48. _export("DemoViewComp", DemoViewComp = (_dec = ccclass('DemoViewComp'), _dec2 = (_crd && ecs === void 0 ? (_reportPossibleCrUseOfecs({
  49. error: Error()
  50. }), ecs) : ecs).register('DemoView', false), _dec(_class = _dec2(_class = class DemoViewComp extends (_crd && CCComp === void 0 ? (_reportPossibleCrUseOfCCComp({
  51. error: Error()
  52. }), CCComp) : CCComp) {
  53. start() {
  54. var _this$getNode;
  55. this.setButton();
  56. this.setEvent("onGlobal1", "onGlobal2");
  57. var Lb = this.getNode("textLb");
  58. console.log("Lb", Lb);
  59. var text = (_this$getNode = this.getNode("textLb")) == null ? void 0 : _this$getNode.getComponent(Label);
  60. if (text) {
  61. text.string = "这是开始游戏的场景";
  62. }
  63. }
  64. btn_simple(event) {
  65. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  66. error: Error()
  67. }), oops) : oops).gui.toast("触发简单按钮触摸事件");
  68. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  69. error: Error()
  70. }), oops) : oops).message.dispatchEvent("onGlobal1", "触发全局事件1");
  71. }
  72. onGlobal1(event, args) {
  73. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  74. error: Error()
  75. }), oops) : oops).gui.toast(args);
  76. }
  77. onGlobal2(event, args) {
  78. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  79. error: Error()
  80. }), oops) : oops).gui.toast(args);
  81. }
  82. reset() {
  83. this.node.destroy();
  84. }
  85. }) || _class) || _class));
  86. _cclegacy._RF.pop();
  87. _crd = false;
  88. }
  89. };
  90. });
  91. //# sourceMappingURL=85fd69e1a920288617adf1b8791df9dbe36d4a4c.js.map