@ives_xxz/framework 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,8 @@
1
- import { FWSystemDefine } from "../define/FWSystemDefine";
2
- import FWLayer from "../layer/FWLayer";
3
- import { FWLayerData } from "../manager/FWLayerManager";
4
- import { FrameworkBase } from "../FrameworkBase";
5
- export abstract class FWLayerController
6
- extends FrameworkBase
7
- implements FW.LayerController
8
- {
1
+ import { FWSystemDefine } from '../define/FWSystemDefine';
2
+ import FWLayer from '../layer/FWLayer';
3
+ import { FWLayerData } from '../manager/FWLayerManager';
4
+ import { FrameworkBase } from '../FrameworkBase';
5
+ export abstract class FWLayerController extends FrameworkBase implements FW.LayerController {
9
6
  readonly entry: FW.Entry = FW.Entry;
10
7
  /** layer数据 */
11
8
  layerData: FWLayerData;
@@ -78,20 +75,16 @@ export abstract class FWLayerController
78
75
  referenceNode: cc.Node,
79
76
  type?: {
80
77
  prototype: T;
81
- }
78
+ },
82
79
  ) {
83
80
  return this.find(path, referenceNode)?.getComponent<T>(type);
84
81
  }
85
82
 
86
- getComponentsInChildren<T extends cc.Component = cc.Component>(type: {
87
- prototype: T;
88
- }) {
83
+ getComponentsInChildren<T extends cc.Component = cc.Component>(type: { prototype: T }) {
89
84
  return this.layer.getComponentsInChildren(type);
90
85
  }
91
86
 
92
- getComponentInChildren<T extends cc.Component = cc.Component>(type: {
93
- prototype: T;
94
- }) {
87
+ getComponentInChildren<T extends cc.Component = cc.Component>(type: { prototype: T }) {
95
88
  return this.layer.getComponentInChildren(type);
96
89
  }
97
90
 
@@ -100,16 +93,12 @@ export abstract class FWLayerController
100
93
  */
101
94
  registerEvent(args: FW.RegisterArgs): void {
102
95
  args.target = args.target || this;
103
- args.CCEvent?.forEach(
104
- (v) => (v.responseInterval = this.defaultResponseInterval)
105
- );
106
- args.FWEvent?.forEach(
107
- (v) => (v.responseInterval = this.defaultResponseInterval)
108
- );
96
+ args.CCEvent?.forEach((v) => (v.responseInterval = this.defaultResponseInterval));
97
+ args.FWEvent?.forEach((v) => (v.responseInterval = this.defaultResponseInterval));
109
98
  return this.entry.uiMgr.register({
110
99
  target: this,
111
- CCEvent: args?.CCEvent ? args?.CCEvent : [],
112
- FWEvent: args?.FWEvent ? args?.FWEvent : [],
100
+ CCEvent: args?.CCEvent || undefined,
101
+ FWEvent: args?.FWEvent || undefined,
113
102
  });
114
103
  }
115
104
 
@@ -117,7 +106,7 @@ export abstract class FWLayerController
117
106
  target: cc.Node,
118
107
  cb: (event: cc.Event) => void,
119
108
  responseInterval?: number,
120
- eventName?: string
109
+ eventName?: string,
121
110
  ): this {
122
111
  this.registerEvent({
123
112
  target: this,
@@ -138,7 +127,7 @@ export abstract class FWLayerController
138
127
  eventName: string,
139
128
  cb: (event: cc.Event) => void,
140
129
  target?: cc.Node,
141
- responseInterval?: number
130
+ responseInterval?: number,
142
131
  ): this {
143
132
  this.registerEvent({
144
133
  target: target || this,
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
- "keywords": [
7
- "123456"
8
- ],
6
+ "keywords": ["123456"],
9
7
  "author": "ives",
10
8
  "license": "ISC"
11
9
  }