@ives_xxz/framework 1.6.6 → 2.0.0

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.
Files changed (58) hide show
  1. package/Framework.ts +9 -13
  2. package/FrameworkAutoInitialize.ts +58 -0
  3. package/{CC.d.ts.meta → FrameworkAutoInitialize.ts.meta} +1 -1
  4. package/FrameworkBase.ts +24 -23
  5. package/animation/FWSkeleton.ts +5 -6
  6. package/component/FWVirtualViewComponent.ts +42 -45
  7. package/config/FWAssetConfig.ts +2 -2
  8. package/controller/FWLayerController.ts +3 -7
  9. package/data/FWData.ts +2 -3
  10. package/define/FWEventDefine.ts +24 -21
  11. package/define/FWSystemDefine.ts +127 -132
  12. package/define/FWSystemDefine.ts.meta +1 -1
  13. package/entry/FWEntry.ts +2 -3
  14. package/expand/FWDecorator.ts +56 -114
  15. package/expand/FWRollingViewNesting.ts +3 -5
  16. package/item/FWVirtualListItem.ts +1 -1
  17. package/language/FWLanguage.ts +15 -19
  18. package/layer/FWLayer.ts +1 -1
  19. package/log/FWLog.ts +30 -35
  20. package/logic/FWLogic.ts +2 -4
  21. package/machine/FWStateMachine.ts +1 -2
  22. package/manager/FWAnimationManager.ts +6 -8
  23. package/manager/FWAssetManager.ts +22 -23
  24. package/manager/FWAudioManager.ts +30 -52
  25. package/manager/FWBundleManager.ts +2 -4
  26. package/manager/FWComponentManager.ts +0 -1
  27. package/manager/FWEngineManager.ts +9 -12
  28. package/manager/FWEventManager.ts +4 -7
  29. package/manager/FWHotUpdateManager.ts +32 -33
  30. package/manager/FWLanguageManager.ts +1 -2
  31. package/manager/FWLayerManager.ts +88 -138
  32. package/manager/FWManager.ts +1 -3
  33. package/manager/FWObjectManager.ts +7 -9
  34. package/manager/FWPerformanceManager.ts +2 -3
  35. package/manager/FWPromiseManager.ts +29 -28
  36. package/manager/FWResManager.ts +1 -3
  37. package/manager/FWSocketManager.ts +2 -5
  38. package/manager/FWStateManager.ts +2 -4
  39. package/manager/FWTimeManager.ts +14 -15
  40. package/manager/FWUiManager.ts +3 -4
  41. package/package.json +1 -1
  42. package/{register → registry}/FWRegistry.ts +8 -8
  43. package/service/http/FWHttp.ts +5 -7
  44. package/service/socket/FWSocket.ts +28 -43
  45. package/service/socket/FWSocketHandle.ts +3 -6
  46. package/service/socket/FWSocketSender.ts +5 -9
  47. package/types/Creator.d.ts.meta +6 -0
  48. package/{FW.d.ts → types/FW.d.ts} +407 -153
  49. package/types/Global.d.ts +21 -0
  50. package/{render/FWAssembler.ts.meta → types/Global.d.ts.meta} +1 -1
  51. package/types.meta +13 -0
  52. package/utils/FWObjectPool.ts +5 -7
  53. package/utils/FWTask.ts +18 -22
  54. package/render/FWAssembler.ts +0 -11
  55. /package/{register → registry}/FWRegistry.ts.meta +0 -0
  56. /package/{register.meta → registry.meta} +0 -0
  57. /package/{CC.d.ts → types/Creator.d.ts} +0 -0
  58. /package/{FW.d.ts.meta → types/FW.d.ts.meta} +0 -0
@@ -1,152 +1,147 @@
1
- export namespace FWSystemDefine {
2
- export enum FWBindTag {
3
- LOGIC,
4
- DATA,
5
- CONFIG,
6
- SENDER,
7
- HANDLE,
8
- SUB_LOGIC,
9
- }
10
- export enum FWObjectType {
11
- ACTIVE,
12
- OPACITY,
13
- }
1
+ export class FWBindTag {
2
+ LOGIC = 0;
3
+ DATA = 1;
4
+ CONFIG = 2;
5
+ SENDER = 3;
6
+ HANDLE = 4;
7
+ SUB_LOGIC = 5;
8
+ }
9
+
10
+ export class FWObjectType {
11
+ ACTIVE = 0;
12
+ OPACITY = 1;
13
+ }
14
14
 
15
- /** Layer渲染顺序 */
16
- export const enum FWLayerRenderOrder {
17
- SCENE = 0,
18
- PERMANENT = 10,
19
- UI = 100,
20
- POPUP = 1000,
21
- MAX = 10000,
22
- }
15
+ /** Layer渲染顺序 */
16
+ export class FWLayerRenderOrder {
17
+ SCENE = 0;
18
+ PERMANENT = 10;
19
+ UI = 100;
20
+ POPUP = 1000;
21
+ MAX = 10000;
22
+ }
23
+
24
+ /**
25
+ * layer类型
26
+ */
27
+ export class FWLayerType {
23
28
  /**
24
- * layer类型
29
+ * 常驻
25
30
  */
26
- export const enum FWLayerType {
27
- /**
28
- * 常驻
29
- */
30
- PERMANENT,
31
- /**
32
- * 可重复打开
33
- */
34
- REPEAT,
35
- /**
36
- * 弹出式(需要加入队列)
37
- */
38
- POPUP_QUEUE,
39
- /**
40
- * 弹出式(一次性,无需加入队列)
41
- */
42
- POPUP_DISPOSABLE,
43
- }
44
-
45
- export enum FWTaskStatus {
46
- IDLE = 'IDLE',
47
- RUNNING = 'RUNNING',
48
- PAUSED = 'PAUSED',
49
- COMPLETED = 'COMPLETED',
50
- }
31
+ PERMANENT = 0;
32
+ /**
33
+ * 可重复打开
34
+ */
35
+ REPEAT = 1;
36
+ /**
37
+ * 弹出式(需要加入队列)
38
+ */
39
+ POPUP_QUEUE = 2;
40
+ /**
41
+ * 弹出式(一次性,无需加入队列)
42
+ */
43
+ POPUP_DISPOSABLE = 3;
44
+ }
51
45
 
52
- export enum FWPriorityOrder {
53
- /**
54
- * 优先级高
55
- */
56
- HIGHT,
57
- /**
58
- * 优先级普通
59
- */
60
- NORMAL,
61
- /**
62
- * 优先级低
63
- */
64
- LOW,
65
- }
46
+ export class FWTaskStatus {
47
+ IDLE = 'IDLE';
48
+ RUNNING = 'RUNNING';
49
+ PAUSED = 'PAUSED';
50
+ COMPLETED = 'COMPLETED';
51
+ }
66
52
 
53
+ export class FWPriorityOrder {
67
54
  /**
68
- * 日志类型
55
+ * 优先级高
69
56
  */
70
- export const enum FWLogType {
71
- /** 调试信息 */
72
- DEBUG,
73
- /** socket请求 */
74
- SOCKET_SEND,
75
- /** socket接收 */
76
- SOCKET_RECEIVE,
77
- /**请求信息 */
78
- REQUEST,
79
- /** 响应信息 */
80
- RESPONSE,
81
- /** 警告信息 */
82
- WARN,
83
- /** 错误信息 */
84
- ERROR,
85
- /** 系统信息 */
86
- SYSTEM,
87
- }
88
-
57
+ HIGHT = 0;
89
58
  /**
90
- * HTTP请求类型
59
+ * 优先级普通
91
60
  */
92
- export const enum FWHttpRequestType {
93
- GET = 'GET',
94
- POST = 'POST',
95
- }
96
-
61
+ NORMAL = 1;
97
62
  /**
98
- * 动画机类型
63
+ * 优先级低
99
64
  */
100
- export const enum FWAnimationMachineType {
101
- TWEEN = 'TWEEN',
102
- SKELETON = 'SKELETON',
103
- ANIMATION = 'ANIMATION',
104
- }
65
+ LOW = 2;
66
+ }
67
+
68
+ /**
69
+ * 日志类型
70
+ */
71
+ export class FWLogType {
72
+ /** 调试信息 */
73
+ DEBUG = 0;
74
+ /** socket请求 */
75
+ SOCKET_SEND = 1;
76
+ /** socket接收 */
77
+ SOCKET_RECEIVE = 2;
78
+ /** 请求信息 */
79
+ REQUEST = 3;
80
+ /** 响应信息 */
81
+ RESPONSE = 4;
82
+ /** 警告信息 */
83
+ WARN = 5;
84
+ /** 错误信息 */
85
+ ERROR = 6;
86
+ /** 系统信息 */
87
+ SYSTEM = 7;
88
+ }
89
+
90
+ /**
91
+ * HTTP请求类型
92
+ */
93
+ export class FWHttpRequestType {
94
+ GET = 'GET';
95
+ POST = 'POST';
96
+ }
105
97
 
106
- export const enum CCEventType {
107
- ON_SHOW = 'ON_SHOW',
108
- ON_HIDE = 'ON_HIDE',
109
- }
98
+ /**
99
+ * 动画机类型
100
+ */
101
+ export class FWAnimationMachineType {
102
+ TWEEN = 'TWEEN';
103
+ SKELETON = 'SKELETON';
104
+ ANIMATION = 'ANIMATION';
105
+ }
110
106
 
111
- export enum FWScrollViewTemplateType {
112
- NODE,
113
- PREFAB,
114
- }
107
+ export class FWScrollViewTemplateType {
108
+ NODE = 0;
109
+ PREFAB = 1;
110
+ }
115
111
 
116
- export enum FWScrollViewSlideType {
117
- NORMAL,
118
- ADHERING,
119
- PAGE,
120
- }
112
+ export class FWScrollViewSlideType {
113
+ NORMAL = 0;
114
+ ADHERING = 1;
115
+ PAGE = 2;
116
+ }
121
117
 
122
- export enum FWScrollViewSelectedType {
123
- NONE,
124
- SINGLE,
125
- MULTIPLE,
126
- }
118
+ export class FWScrollViewSelectedType {
119
+ NONE = 0;
120
+ SINGLE = 1;
121
+ MULTIPLE = 2;
122
+ }
127
123
 
128
- export enum FWLanguageAssetType {
129
- LABEL = 'label',
130
- SPRITE = 'sprite',
131
- SKELETON = 'skeleton',
132
- }
124
+ export class FWLanguageAssetType {
125
+ LABEL = 'label';
126
+ SPRITE = 'sprite';
127
+ SKELETON = 'skeleton';
128
+ }
133
129
 
134
- export enum FWPromiseStatus {
135
- PENDING = 'pending',
136
- FULFILLED = 'fulfilled',
137
- REJECTED = 'rejected',
138
- CANCELLED = 'cancelled',
139
- }
130
+ export class FWPromiseStatus {
131
+ PENDING = 'pending';
132
+ FULFILLED = 'fulfilled';
133
+ REJECTED = 'rejected';
134
+ CANCELLED = 'cancelled';
135
+ }
140
136
 
141
- export enum FWLayerState {
142
- CLOSED = 'closed',
143
- OPENING = 'opening',
144
- OPENED = 'opened',
145
- CLOSING = 'closing',
146
- }
137
+ export class FWLayerState {
138
+ CLOSED = 'closed';
139
+ OPENING = 'opening';
140
+ OPENED = 'opened';
141
+ CLOSING = 'closing';
142
+ }
147
143
 
148
- export enum FWAudioType {
149
- MUSIC,
150
- SOUND,
151
- }
144
+ export class FWAudioType {
145
+ MUSIC = 0;
146
+ SOUND = 1;
152
147
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "ver": "1.1.0",
3
- "uuid": "08a489c7-1eb2-493f-9fc2-604b47fe6bcf",
3
+ "uuid": "87adc2ef-9225-4ba8-9dba-5c0d192d2716",
4
4
  "importer": "typescript",
5
5
  "isPlugin": false,
6
6
  "loadPluginInWeb": true,
package/entry/FWEntry.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import FWUiManager from '../manager/FWUiManager';
2
- import FWLog from '../log/FWLog';
3
2
  import FWAnimationManager from '../manager/FWAnimationManager';
4
3
  import FWAudioManager from '../manager/FWAudioManager';
5
4
  import FWComponentManager from '../manager/FWComponentManager';
@@ -22,7 +21,7 @@ import { FWPerformanceManager } from '../manager/FWPerformanceManager';
22
21
  /**
23
22
  * 入口脚本
24
23
  */
25
- export default class FWEntry implements FW.Entry {
24
+ export class FWEntry implements FW.Entry {
26
25
  map: Map<string, FW.RegisterBundle>;
27
26
  /**
28
27
  * 事件管理器
@@ -144,7 +143,7 @@ export default class FWEntry implements FW.Entry {
144
143
  this.bundleName = '';
145
144
  return;
146
145
  } catch (e) {
147
- FWLog.error('launchScene failed:', name);
146
+ FW.Log.error('launchScene failed:', name);
148
147
  }
149
148
  }
150
149
 
@@ -1,13 +1,6 @@
1
- import "reflect-metadata";
2
- import FWLog from "../log/FWLog";
1
+ import 'reflect-metadata';
3
2
 
4
- type PropertyDecorator = (
5
- $class: Record<string, any>,
6
- $propertyKey: string | symbol,
7
- $descriptorOrInitializer?: any
8
- ) => void;
9
-
10
- export const searchChild = function (node: cc.Node, name: string) {
3
+ export function searchChild(node: cc.Node, name: string) {
11
4
  let ret = node.getChildByName(name);
12
5
  if (ret) return ret;
13
6
  for (let i = 0; i < node.children.length; i++) {
@@ -17,57 +10,49 @@ export const searchChild = function (node: cc.Node, name: string) {
17
10
  if (ret) return ret;
18
11
  }
19
12
  return null;
20
- };
13
+ }
21
14
 
22
15
  const CookDecoratorKey = ($desc: string) => `__ccc_decorator_${$desc}__`;
23
16
 
24
- const KeyChild = CookDecoratorKey("child_cache");
17
+ const KeyChild = CookDecoratorKey('child_cache');
25
18
 
26
19
  type ParamType = {
27
20
  path?: string;
28
21
  };
29
22
 
30
- export function FWPropertyNode($opt?: ParamType): PropertyDecorator {
23
+ export function FWPropertyNode($opt?: ParamType): FW.PropertyDecorator {
31
24
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
25
  return ($target, $propertyKey: string, $descriptorOrInitializer) => {
33
- const cache: { propertyKey: string; childName: string }[] = ($target[
34
- KeyChild
35
- ] ??= []);
26
+ const cache: { propertyKey: string; childName: string }[] = ($target[KeyChild] ??= []);
36
27
  if (!cache.some(($vo) => $vo.propertyKey === $propertyKey)) {
37
28
  cache.push({
38
29
  propertyKey: $propertyKey,
39
30
  childName: $opt?.path || $propertyKey,
40
31
  });
41
32
  } else {
42
- throw new Error(
43
- `child 装饰器重复绑定属性:${$propertyKey},class:${$target?.name}`
44
- );
33
+ throw new Error(`child 装饰器重复绑定属性:${$propertyKey},class:${$target?.name}`);
45
34
  }
46
35
  if (cache.length === 1) {
47
36
  const oldOnLoad: () => void = $target.onLoad || undefined;
48
37
  $target.onLoad = function () {
49
- cache.forEach(
50
- ($vo) =>
51
- (this[$vo.propertyKey] = searchChild(this.node, $vo.childName))
52
- );
38
+ cache.forEach(($vo) => (this[$vo.propertyKey] = searchChild(this.node, $vo.childName)));
53
39
  oldOnLoad && oldOnLoad.apply(this);
54
40
  };
55
41
  }
56
42
  };
57
43
  }
58
44
 
59
- const KeyChildMulti = CookDecoratorKey("child_cache_multi"); // 重新定义 Key,避免冲突
45
+ const KeyChildMulti = CookDecoratorKey('child_cache_multi'); // 重新定义 Key,避免冲突
60
46
 
61
47
  /** 查找多个节点,并存储为数组 */
62
- export function FWPropertyNodes(...paths: string[]): PropertyDecorator {
48
+ export function FWPropertyNodes(...paths: string[]): FW.PropertyDecorator {
63
49
  return ($target: any, $propertyKey: string) => {
64
50
  // 确保 $target[KeyChild] 是数组
65
51
  if (!$target[KeyChildMulti]) {
66
52
  $target[KeyChildMulti] = [];
67
53
  }
68
54
 
69
- const cache: { propertyKey: string; childNames: string[] }[] =
70
- $target[KeyChildMulti];
55
+ const cache: { propertyKey: string; childNames: string[] }[] = $target[KeyChildMulti];
71
56
 
72
57
  // 查找是否已经存在该属性的绑定
73
58
  const existingEntry = cache.find(($vo) => $vo.propertyKey === $propertyKey);
@@ -80,7 +65,7 @@ export function FWPropertyNodes(...paths: string[]): PropertyDecorator {
80
65
  });
81
66
  } else {
82
67
  throw new Error(
83
- `child 装饰器重复绑定属性:${$propertyKey}, class:${$target.constructor.name}`
68
+ `child 装饰器重复绑定属性:${$propertyKey}, class:${$target.constructor.name}`,
84
69
  );
85
70
  }
86
71
 
@@ -123,13 +108,13 @@ interface INewable<T = any> extends Function {
123
108
  new (...args: any[]): T;
124
109
  }
125
110
 
126
- const KeyComp = CookDecoratorKey("comp_cache");
111
+ const KeyComp = CookDecoratorKey('comp_cache');
127
112
 
128
113
  export function FWPropertyComponent(
129
114
  $componentClass: INewable<cc.Component>,
130
115
  $childName?: string,
131
- $mute = false
132
- ): PropertyDecorator {
116
+ $mute = false,
117
+ ): FW.PropertyDecorator {
133
118
  return ($target, $propertyKey: string, $descriptorOrInitializer) => {
134
119
  const cache: {
135
120
  propertyKey: string;
@@ -144,9 +129,7 @@ export function FWPropertyComponent(
144
129
  });
145
130
  } else {
146
131
  if (!$mute) {
147
- throw new Error(
148
- `component装饰器重复绑定属性:${$propertyKey},class:${$target.name}`
149
- );
132
+ throw new Error(`component装饰器重复绑定属性:${$propertyKey},class:${$target.name}`);
150
133
  }
151
134
  return;
152
135
  }
@@ -154,21 +137,18 @@ export function FWPropertyComponent(
154
137
  const oldOnLoad: () => void = $target.onLoad || undefined; //$target.onLoad也可以拿到父类的实现
155
138
  $target.onLoad = function () {
156
139
  cache.forEach(($vo) => {
157
- const node = $vo.childName
158
- ? searchChild(this.node, $vo.childName)
159
- : this.node;
140
+ const node = $vo.childName ? searchChild(this.node, $vo.childName) : this.node;
160
141
  if (!node) {
161
142
  if (!$mute) {
162
143
  throw new Error(
163
- `component装饰器没有找到适合的node节点:class:${$target?.name},组件:${$componentClass?.name},childName:${$childName}`
144
+ `component装饰器没有找到适合的node节点:class:${$target?.name},组件:${$componentClass?.name},childName:${$childName}`,
164
145
  );
165
146
  } else {
166
147
  return;
167
148
  }
168
149
  }
169
150
  this[$vo.propertyKey] =
170
- node.getComponent($vo.compClass) ||
171
- node.addComponent($vo.compClass);
151
+ node.getComponent($vo.compClass) || node.addComponent($vo.compClass);
172
152
  });
173
153
  oldOnLoad && oldOnLoad.apply(this);
174
154
  };
@@ -178,8 +158,8 @@ export function FWPropertyComponent(
178
158
 
179
159
  export function FWPropertyComponents(
180
160
  $componentClass: INewable<cc.Component>,
181
- $childName?: string
182
- ): PropertyDecorator {
161
+ $childName?: string,
162
+ ): FW.PropertyDecorator {
183
163
  return ($target, $propertyKey: string, $descriptorOrInitializer) => {
184
164
  const componentName = $childName || $propertyKey;
185
165
  const oldOnLoad: () => void = $target.onLoad || undefined; //$target.onLoad也可以拿到父类的实现
@@ -223,11 +203,7 @@ export function isNull(message?: string) {
223
203
  }
224
204
 
225
205
  export function FWSocketAutoProcessPause() {
226
- return function (
227
- target: any,
228
- propertyKey: string,
229
- descriptor: PropertyDescriptor
230
- ) {
206
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
231
207
  const originalMethod = descriptor.value;
232
208
 
233
209
  descriptor.value = async function (...args: any[]) {
@@ -235,7 +211,7 @@ export function FWSocketAutoProcessPause() {
235
211
  const result = await originalMethod.apply(this, args);
236
212
  return result;
237
213
  } finally {
238
- FWLog.debug("暂停socket消息处理");
214
+ FW.Log.debug('暂停socket消息处理');
239
215
  FW.Entry.socketMgr.resumeMessageHandle();
240
216
  }
241
217
  };
@@ -245,25 +221,17 @@ export function FWSocketAutoProcessPause() {
245
221
  }
246
222
 
247
223
  export function FWDeprecated(description?: string) {
248
- return function (
249
- target: any,
250
- propertyKey: string,
251
- descriptor: PropertyDescriptor
252
- ) {
224
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
253
225
  const originalMethod = descriptor.value;
254
226
  descriptor.value = async function (...args: any[]) {
255
- FWLog.warn(`${propertyKey}方法已弃用!${description || ""}`);
227
+ FW.Log.warn(`${propertyKey}方法已弃用!${description || ''}`);
256
228
  originalMethod.apply(this, args);
257
229
  };
258
230
  return descriptor;
259
231
  };
260
232
  }
261
233
  export function FWSocketAutoProcessResume() {
262
- return function (
263
- target: any,
264
- propertyKey: string,
265
- descriptor: PropertyDescriptor
266
- ) {
234
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
267
235
  const originalMethod = descriptor.value;
268
236
 
269
237
  descriptor.value = async function (...args: any[]) {
@@ -271,7 +239,7 @@ export function FWSocketAutoProcessResume() {
271
239
  const result = await originalMethod.apply(this, args);
272
240
  return result;
273
241
  } finally {
274
- FWLog.debug("恢复socket消息处理");
242
+ FW.Log.debug('恢复socket消息处理');
275
243
  FW.Entry.socketMgr.resumeMessageHandle();
276
244
  }
277
245
  };
@@ -281,11 +249,7 @@ export function FWSocketAutoProcessResume() {
281
249
  }
282
250
 
283
251
  export function RegisterEvents(events: FW.RegisterEventArgs[]) {
284
- return function (
285
- target: any,
286
- propertyKey: string,
287
- descriptor: PropertyDescriptor
288
- ) {
252
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
289
253
  const originalMethod = descriptor.value;
290
254
 
291
255
  descriptor.value = function (...args: any[]) {
@@ -300,11 +264,7 @@ export function RegisterEvents(events: FW.RegisterEventArgs[]) {
300
264
  }
301
265
 
302
266
  export function AutoRegisterCCEvent(nodePath: string, eventName?: string) {
303
- return function (
304
- target: any,
305
- propertyKey: string,
306
- descriptor: PropertyDescriptor
307
- ) {
267
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
308
268
  const originalMethod = descriptor.value;
309
269
  const originalOnInit = target.onInit;
310
270
  const evt = eventName || cc.Node.EventType.TOUCH_END;
@@ -315,9 +275,7 @@ export function AutoRegisterCCEvent(nodePath: string, eventName?: string) {
315
275
  let targetNode: cc.Node | null = null;
316
276
 
317
277
  const cachedNodes = this[KeyChild] || [];
318
- const cachedNode = cachedNodes.find(
319
- (vo: any) => vo.childName === nodePath
320
- );
278
+ const cachedNode = cachedNodes.find((vo: any) => vo.childName === nodePath);
321
279
 
322
280
  if (cachedNode && this[cachedNode.propertyKey]) {
323
281
  targetNode = this[cachedNode.propertyKey];
@@ -325,7 +283,7 @@ export function AutoRegisterCCEvent(nodePath: string, eventName?: string) {
325
283
  targetNode = searchChild(this.layer?.node || this.node, nodePath);
326
284
 
327
285
  if (targetNode && !cachedNode) {
328
- const cacheKey = `_cached_${nodePath.replace(/\//g, "_")}`;
286
+ const cacheKey = `_cached_${nodePath.replace(/\//g, '_')}`;
329
287
  this[cacheKey] = targetNode;
330
288
  if (!this[KeyChild]) this[KeyChild] = [];
331
289
  this[KeyChild].push({
@@ -336,53 +294,45 @@ export function AutoRegisterCCEvent(nodePath: string, eventName?: string) {
336
294
  }
337
295
 
338
296
  if (targetNode) {
339
- this.registerEvent({
340
- CCEvent: [
341
- {
342
- eventName: evt,
343
- cb: originalMethod.bind(this),
344
- target: targetNode,
345
- }
346
- ]
347
- });
348
- FWLog.debug(`自动注册事件: ${nodePath} -> ${propertyKey}`);
297
+ this.registerEvent({
298
+ CCEvent: [
299
+ {
300
+ eventName: evt,
301
+ cb: originalMethod.bind(this),
302
+ target: targetNode,
303
+ },
304
+ ],
305
+ });
306
+ FW.Log.debug(`自动注册事件: ${nodePath} -> ${propertyKey}`);
349
307
  } else {
350
- FWLog.warn(`自动注册事件失败: 未找到节点 ${nodePath}`);
308
+ FW.Log.warn(`自动注册事件失败: 未找到节点 ${nodePath}`);
351
309
  }
352
310
  };
353
311
  };
354
312
  }
355
313
 
356
314
  export function AutoRegisterFWEvent(eventName: any) {
357
- return function (
358
- target: any,
359
- propertyKey: string,
360
- descriptor: PropertyDescriptor
361
- ) {
315
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
362
316
  const originalMethod = descriptor.value;
363
317
  const originalOnInit = target.onInit;
364
318
 
365
319
  target.onInit = function (...args) {
366
320
  originalOnInit?.call(this, args);
367
- this.registerEvent({
368
- CCEvent: [
369
- {
370
- eventName: eventName,
371
- cb: originalMethod.bind(this),
372
- target: this,
373
- }
374
- ]
375
- });
321
+ this.registerEvent({
322
+ CCEvent: [
323
+ {
324
+ eventName: eventName,
325
+ cb: originalMethod.bind(this),
326
+ target: this,
327
+ },
328
+ ],
329
+ });
376
330
  };
377
331
  };
378
332
  }
379
333
 
380
334
  export function PerformanceMonitor(operationName?: string) {
381
- return function (
382
- target: any,
383
- propertyKey: string,
384
- descriptor: PropertyDescriptor
385
- ) {
335
+ return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
386
336
  const originalMethod = descriptor.value;
387
337
 
388
338
  descriptor.value = async function (...args: any[]) {
@@ -400,24 +350,16 @@ export function PerformanceMonitor(operationName?: string) {
400
350
  const result = await originalMethod.apply(this, args);
401
351
  const duration = Date.now() - startTime;
402
352
 
403
- FW.Entry.performanceMgr?.recordOperationMetric(
404
- moduleName,
405
- methodName,
406
- duration
407
- );
353
+ FW.Entry.performanceMgr?.recordOperationMetric(moduleName, methodName, duration);
408
354
 
409
355
  if (duration > 100) {
410
- FWLog.warn(`[${moduleName}] ${methodName} took ${duration}ms`);
356
+ FW.Log.warn(`[${moduleName}] ${methodName} took ${duration}ms`);
411
357
  }
412
358
 
413
359
  return result;
414
360
  } catch (error) {
415
361
  const duration = Date.now() - startTime;
416
- FW.Entry.performanceMgr?.recordOperationMetric(
417
- moduleName,
418
- `${methodName}_error`,
419
- duration
420
- );
362
+ FW.Entry.performanceMgr?.recordOperationMetric(moduleName, `${methodName}_error`, duration);
421
363
  throw error;
422
364
  }
423
365
  };
@@ -1,5 +1,3 @@
1
- import FWLog from '../log/FWLog';
2
-
3
1
  const { ccclass, property, menu } = cc._decorator;
4
2
 
5
3
  interface EventTouch extends cc.Event.EventTouch {
@@ -59,9 +57,9 @@ export default class FWRollingViewNesting extends cc.Component {
59
57
  let touch = event.touch;
60
58
  if (viewGroup.content) {
61
59
  if (viewGroup instanceof cc.PageView) {
62
- viewGroup['_touchEndPosition'] = touch.getLocation();
63
- }
64
- viewGroup._handleReleaseLogic(touch);
60
+ viewGroup['_touchEndPosition'] = touch.getLocation();
61
+ }
62
+ viewGroup._handleReleaseLogic(touch);
65
63
  }
66
64
  }
67
65
  if (