@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.
- package/Framework.ts +9 -13
- package/FrameworkAutoInitialize.ts +58 -0
- package/{CC.d.ts.meta → FrameworkAutoInitialize.ts.meta} +1 -1
- package/FrameworkBase.ts +24 -23
- package/animation/FWSkeleton.ts +5 -6
- package/component/FWVirtualViewComponent.ts +42 -45
- package/config/FWAssetConfig.ts +2 -2
- package/controller/FWLayerController.ts +3 -7
- package/data/FWData.ts +2 -3
- package/define/FWEventDefine.ts +24 -21
- package/define/FWSystemDefine.ts +127 -132
- package/define/FWSystemDefine.ts.meta +1 -1
- package/entry/FWEntry.ts +2 -3
- package/expand/FWDecorator.ts +56 -114
- package/expand/FWRollingViewNesting.ts +3 -5
- package/item/FWVirtualListItem.ts +1 -1
- package/language/FWLanguage.ts +15 -19
- package/layer/FWLayer.ts +1 -1
- package/log/FWLog.ts +30 -35
- package/logic/FWLogic.ts +2 -4
- package/machine/FWStateMachine.ts +1 -2
- package/manager/FWAnimationManager.ts +6 -8
- package/manager/FWAssetManager.ts +22 -23
- package/manager/FWAudioManager.ts +30 -52
- package/manager/FWBundleManager.ts +2 -4
- package/manager/FWComponentManager.ts +0 -1
- package/manager/FWEngineManager.ts +9 -12
- package/manager/FWEventManager.ts +4 -7
- package/manager/FWHotUpdateManager.ts +32 -33
- package/manager/FWLanguageManager.ts +1 -2
- package/manager/FWLayerManager.ts +88 -138
- package/manager/FWManager.ts +1 -3
- package/manager/FWObjectManager.ts +7 -9
- package/manager/FWPerformanceManager.ts +2 -3
- package/manager/FWPromiseManager.ts +29 -28
- package/manager/FWResManager.ts +1 -3
- package/manager/FWSocketManager.ts +2 -5
- package/manager/FWStateManager.ts +2 -4
- package/manager/FWTimeManager.ts +14 -15
- package/manager/FWUiManager.ts +3 -4
- package/package.json +1 -1
- package/{register → registry}/FWRegistry.ts +8 -8
- package/service/http/FWHttp.ts +5 -7
- package/service/socket/FWSocket.ts +28 -43
- package/service/socket/FWSocketHandle.ts +3 -6
- package/service/socket/FWSocketSender.ts +5 -9
- package/types/Creator.d.ts.meta +6 -0
- package/{FW.d.ts → types/FW.d.ts} +407 -153
- package/types/Global.d.ts +21 -0
- package/{render/FWAssembler.ts.meta → types/Global.d.ts.meta} +1 -1
- package/types.meta +13 -0
- package/utils/FWObjectPool.ts +5 -7
- package/utils/FWTask.ts +18 -22
- package/render/FWAssembler.ts +0 -11
- /package/{register → registry}/FWRegistry.ts.meta +0 -0
- /package/{register.meta → registry.meta} +0 -0
- /package/{CC.d.ts → types/Creator.d.ts} +0 -0
- /package/{FW.d.ts.meta → types/FW.d.ts.meta} +0 -0
|
@@ -52,7 +52,7 @@ export default class FWVirtualListItem extends FWObject {
|
|
|
52
52
|
|
|
53
53
|
_registerEvent() {
|
|
54
54
|
if (!this._eventReg) {
|
|
55
|
-
if (this.btnCom && this.list.selectedMode > 0) {
|
|
55
|
+
if (this.btnCom && (this.list.selectedMode as number) > 0) {
|
|
56
56
|
this.btnCom.clickEvents.unshift(this.createEvt(this, 'onClickThis'));
|
|
57
57
|
}
|
|
58
58
|
if (this.adaptiveSize) {
|
package/language/FWLanguage.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FWLodash } from "../utils/FWLodash";
|
|
1
|
+
import { FWLodash } from '../utils/FWLodash';
|
|
3
2
|
|
|
4
3
|
const { ccclass, property, executeInEditMode } = cc._decorator;
|
|
5
4
|
|
|
@@ -10,11 +9,8 @@ export default abstract class FWLanguage extends cc.Component {
|
|
|
10
9
|
protected _language: number = 0;
|
|
11
10
|
|
|
12
11
|
@property({
|
|
13
|
-
type: FWLodash.CCEnum([
|
|
14
|
-
|
|
15
|
-
...FW.Entry.languageMgr.getSupportedLanguages(),
|
|
16
|
-
]),
|
|
17
|
-
displayName: "language",
|
|
12
|
+
type: FWLodash.CCEnum(['请选择语言', ...FW.Entry.languageMgr.getSupportedLanguages()]),
|
|
13
|
+
displayName: 'language',
|
|
18
14
|
visible: true,
|
|
19
15
|
serializable: true,
|
|
20
16
|
})
|
|
@@ -34,21 +30,21 @@ export default abstract class FWLanguage extends cc.Component {
|
|
|
34
30
|
|
|
35
31
|
private refreshInspector() {
|
|
36
32
|
//@ts-ignore
|
|
37
|
-
Editor.Utils.refreshSelectedInspector(
|
|
33
|
+
Editor.Utils.refreshSelectedInspector('node', this.node.uuid);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
protected onLoad(): void {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
37
|
+
FW.Entry.uiMgr.register({
|
|
38
|
+
FWEvent: [
|
|
39
|
+
{
|
|
40
|
+
eventName: FW.EventDefine.LanguageEvent.LANGUAGE_CHANGE,
|
|
41
|
+
cb: () => {
|
|
42
|
+
this._language = FW.Entry.languageMgr.getLanguageIndex();
|
|
43
|
+
this.onLanguageChange();
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
protected onEnable(): void {
|
package/layer/FWLayer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { ccclass, property } = cc._decorator;
|
|
2
2
|
|
|
3
3
|
@ccclass
|
|
4
|
-
export
|
|
4
|
+
export class FWLayer extends cc.Component implements FW.Layer {
|
|
5
5
|
public readonly entry: FW.Entry = FW.Entry;
|
|
6
6
|
public ctr: FW.LayerController;
|
|
7
7
|
public onLoad(): void {}
|
package/log/FWLog.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]);
|
|
16
|
-
|
|
17
|
-
class FWLog {
|
|
1
|
+
export class FWLog {
|
|
2
|
+
FWLogColorMap: Map<FW.SystemDefine.FWLogType, string> = new Map<
|
|
3
|
+
FW.SystemDefine.FWLogType,
|
|
4
|
+
string
|
|
5
|
+
>([
|
|
6
|
+
[FW.SystemDefine.FWLogType.DEBUG, '#FFFFFF'],
|
|
7
|
+
[FW.SystemDefine.FWLogType.SOCKET_SEND, '#50BBE4'],
|
|
8
|
+
[FW.SystemDefine.FWLogType.SOCKET_RECEIVE, '#F423DF'],
|
|
9
|
+
[FW.SystemDefine.FWLogType.REQUEST, '#23F4C6'],
|
|
10
|
+
[FW.SystemDefine.FWLogType.RESPONSE, '#FF8A00'],
|
|
11
|
+
[FW.SystemDefine.FWLogType.WARN, '#FFC107'],
|
|
12
|
+
[FW.SystemDefine.FWLogType.ERROR, '#DC3545'],
|
|
13
|
+
[FW.SystemDefine.FWLogType.SYSTEM, '#9b1eeeff'],
|
|
14
|
+
]);
|
|
18
15
|
private static instance: FWLog;
|
|
19
16
|
public static getInstance() {
|
|
20
17
|
if (!this.instance) {
|
|
@@ -30,8 +27,8 @@ class FWLog {
|
|
|
30
27
|
return window.console.log.bind(
|
|
31
28
|
window.console,
|
|
32
29
|
`%c[debug]:${FW.Entry.timeMgr.getTime()}`,
|
|
33
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
34
|
-
|
|
30
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
31
|
+
FW.SystemDefine.FWLogType.DEBUG,
|
|
35
32
|
)}; font-weight: bold; font-size: 10;`,
|
|
36
33
|
);
|
|
37
34
|
|
|
@@ -43,8 +40,8 @@ class FWLog {
|
|
|
43
40
|
return window.console.log.bind(
|
|
44
41
|
window.console,
|
|
45
42
|
`%c[sendMsg]:${FW.Entry.timeMgr.getTime()}`,
|
|
46
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
47
|
-
|
|
43
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
44
|
+
FW.SystemDefine.FWLogType.SOCKET_SEND,
|
|
48
45
|
)}; font-weight: bold; font-size: 10;`,
|
|
49
46
|
);
|
|
50
47
|
return console.log;
|
|
@@ -55,8 +52,8 @@ class FWLog {
|
|
|
55
52
|
return window.console.log.bind(
|
|
56
53
|
window.console,
|
|
57
54
|
`%c[receiveMsg]:${FW.Entry.timeMgr.getTime()}`,
|
|
58
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
59
|
-
|
|
55
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
56
|
+
FW.SystemDefine.FWLogType.SOCKET_RECEIVE,
|
|
60
57
|
)}; font-weight: bold; font-size: 10;`,
|
|
61
58
|
);
|
|
62
59
|
return console.log;
|
|
@@ -67,8 +64,8 @@ class FWLog {
|
|
|
67
64
|
return window.console.log.bind(
|
|
68
65
|
window.console,
|
|
69
66
|
`%c[request]:${FW.Entry.timeMgr.getTime()}`,
|
|
70
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
71
|
-
|
|
67
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
68
|
+
FW.SystemDefine.FWLogType.REQUEST,
|
|
72
69
|
)}; font-weight: bold; font-size: 10;`,
|
|
73
70
|
);
|
|
74
71
|
return console.log;
|
|
@@ -79,8 +76,8 @@ class FWLog {
|
|
|
79
76
|
return window.console.log.bind(
|
|
80
77
|
window.console,
|
|
81
78
|
`%c[response]:${FW.Entry.timeMgr.getTime()}`,
|
|
82
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
83
|
-
|
|
79
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
80
|
+
FW.SystemDefine.FWLogType.RESPONSE,
|
|
84
81
|
)}; font-weight: bold; font-size: 10;`,
|
|
85
82
|
);
|
|
86
83
|
return console.log;
|
|
@@ -91,8 +88,8 @@ class FWLog {
|
|
|
91
88
|
return window.console.log.bind(
|
|
92
89
|
window.console,
|
|
93
90
|
`%c[system]:${FW.Entry.timeMgr.getTime()}`,
|
|
94
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
95
|
-
|
|
91
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
92
|
+
FW.SystemDefine.FWLogType.SYSTEM,
|
|
96
93
|
)}; font-weight: bold; font-size: 10;`,
|
|
97
94
|
);
|
|
98
95
|
return console.log;
|
|
@@ -103,8 +100,8 @@ class FWLog {
|
|
|
103
100
|
return window.console.warn.bind(
|
|
104
101
|
window.console,
|
|
105
102
|
`%c[warn]:${FW.Entry.timeMgr.getTime()}`,
|
|
106
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
107
|
-
|
|
103
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
104
|
+
FW.SystemDefine.FWLogType.WARN,
|
|
108
105
|
)}; font-weight: bold; font-size: 10;`,
|
|
109
106
|
);
|
|
110
107
|
return console.warn;
|
|
@@ -115,8 +112,8 @@ class FWLog {
|
|
|
115
112
|
return window.console.error.bind(
|
|
116
113
|
window.console,
|
|
117
114
|
`%c[error]:${FW.Entry.timeMgr.getTime()}`,
|
|
118
|
-
`color: black; background-color: ${FWLogColorMap.get(
|
|
119
|
-
|
|
115
|
+
`color: black; background-color: ${this.FWLogColorMap.get(
|
|
116
|
+
FW.SystemDefine.FWLogType.ERROR,
|
|
120
117
|
)}; font-weight: bold; font-size: 10;`,
|
|
121
118
|
);
|
|
122
119
|
return console.error;
|
|
@@ -128,5 +125,3 @@ if (!CC_DEBUG && !CC_DEV && !CC_BUILD) {
|
|
|
128
125
|
window.console.warn = () => {};
|
|
129
126
|
window.console.error = () => {};
|
|
130
127
|
}
|
|
131
|
-
|
|
132
|
-
export default FWLog.getInstance();
|
package/logic/FWLogic.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { injectable } from
|
|
2
|
-
import { FrameworkBase } from "../FrameworkBase";
|
|
3
|
-
import { FWSystemDefine } from "../define/FWSystemDefine";
|
|
1
|
+
import { injectable } from 'inversify';
|
|
4
2
|
@injectable()
|
|
5
|
-
export
|
|
3
|
+
export class FWLogic extends FW.FrameworkBase {
|
|
6
4
|
public initialize?(): void;
|
|
7
5
|
public onDestroy?(): void;
|
|
8
6
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import FWLog from '../log/FWLog';
|
|
2
1
|
import { FWState } from '../state/FWState';
|
|
3
2
|
|
|
4
3
|
export default class FWStateMachine implements FW.StateMachine {
|
|
@@ -17,7 +16,7 @@ export default class FWStateMachine implements FW.StateMachine {
|
|
|
17
16
|
/** 进入状态 */
|
|
18
17
|
enter(stateType: number, ...args: any): void {
|
|
19
18
|
if (this.stateMap.size == 0) {
|
|
20
|
-
|
|
19
|
+
FW.Log.error('stateMachine is not register!');
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { FWSkeleton } from '../animation/FWSkeleton';
|
|
2
2
|
import { FWTween } from '../animation/FWTween';
|
|
3
3
|
import { FWManager } from './FWManager';
|
|
4
|
-
import { FWSystemDefine } from '../define/FWSystemDefine';
|
|
5
|
-
import FWLog from '../log/FWLog';
|
|
6
4
|
import { FWAnimationMachine } from '../machine/FWAnimationMachine';
|
|
7
5
|
|
|
8
6
|
export default class FWAnimationManager extends FWManager {
|
|
@@ -10,9 +8,9 @@ export default class FWAnimationManager extends FWManager {
|
|
|
10
8
|
public initialize(): void {
|
|
11
9
|
this.animationMachineMap = new Map<string, FWAnimationMachine>();
|
|
12
10
|
|
|
13
|
-
this.createAnimationMachine(
|
|
14
|
-
this.createAnimationMachine(
|
|
15
|
-
this.createAnimationMachine(
|
|
11
|
+
this.createAnimationMachine(FW.SystemDefine.FWAnimationMachineType.TWEEN);
|
|
12
|
+
this.createAnimationMachine(FW.SystemDefine.FWAnimationMachineType.SKELETON);
|
|
13
|
+
this.createAnimationMachine(FW.SystemDefine.FWAnimationMachineType.ANIMATION);
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -22,7 +20,7 @@ export default class FWAnimationManager extends FWManager {
|
|
|
22
20
|
*/
|
|
23
21
|
createTween(args?: FW.TweenArgs) {
|
|
24
22
|
const t = new FWTween();
|
|
25
|
-
const machine = this.animationMachineMap.get(
|
|
23
|
+
const machine = this.animationMachineMap.get(FW.SystemDefine.FWAnimationMachineType.TWEEN);
|
|
26
24
|
t.animationName = args?.tag || '';
|
|
27
25
|
t.animation = cc.tween(args?.target);
|
|
28
26
|
t.timeScale(args?.timeScale || 1);
|
|
@@ -37,7 +35,7 @@ export default class FWAnimationManager extends FWManager {
|
|
|
37
35
|
*/
|
|
38
36
|
createSkeleton(skeleton: sp.Skeleton) {
|
|
39
37
|
const s = new FWSkeleton();
|
|
40
|
-
const machine = this.animationMachineMap.get(
|
|
38
|
+
const machine = this.animationMachineMap.get(FW.SystemDefine.FWAnimationMachineType.SKELETON);
|
|
41
39
|
s.animationName = skeleton.name;
|
|
42
40
|
s.animation = skeleton;
|
|
43
41
|
machine.addAnimation(s);
|
|
@@ -63,7 +61,7 @@ export default class FWAnimationManager extends FWManager {
|
|
|
63
61
|
*/
|
|
64
62
|
private createAnimationMachine(animationMachineName: string) {
|
|
65
63
|
if (this.animationMachineMap.has(animationMachineName)) {
|
|
66
|
-
|
|
64
|
+
FW.Log.warn(`已创建动画机:${animationMachineName},请勿重复注册!`);
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
69
67
|
const machine = new FWAnimationMachine();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FWSystemConfig } from '../config/FWSystemConfig';
|
|
2
|
-
import FWLog from '../log/FWLog';
|
|
3
2
|
import { FWManager } from './FWManager';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -68,7 +67,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
68
67
|
}, FWSystemConfig.PromiseConfig.loadAsset).promise,
|
|
69
68
|
);
|
|
70
69
|
} catch (e) {
|
|
71
|
-
|
|
70
|
+
FW.Log.error('从远程加载spine动画资源失败!');
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
|
|
@@ -93,7 +92,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
93
92
|
|
|
94
93
|
async preLoad(assetProperty: FW.AssetProperty | FW.AssetProperty[]) {
|
|
95
94
|
if (!assetProperty) {
|
|
96
|
-
|
|
95
|
+
FW.Log.error(`加载资源失败,请检查参数列表:${assetProperty}!`);
|
|
97
96
|
return undefined;
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -107,19 +106,19 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
107
106
|
const progress = property.progress;
|
|
108
107
|
|
|
109
108
|
if (!bundleName || bundleName === '') {
|
|
110
|
-
|
|
109
|
+
FW.Log.error(`找不到bundle${bundleName},或者bundle未加载!`);
|
|
111
110
|
return undefined;
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
if (!path || path === '') {
|
|
115
|
-
|
|
114
|
+
FW.Log.error(`找不到资源路径${path},请检查!`);
|
|
116
115
|
return undefined;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
let bundle: cc.AssetManager.Bundle = await this.resMgr.loadBundle(bundleName);
|
|
120
119
|
|
|
121
120
|
if (!bundle) {
|
|
122
|
-
|
|
121
|
+
FW.Log.error(`加载bundle失败,请检查!`);
|
|
123
122
|
return undefined;
|
|
124
123
|
}
|
|
125
124
|
|
|
@@ -152,7 +151,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
152
151
|
*/
|
|
153
152
|
async load(assetProperty: FW.AssetProperty): Promise<FW.AssetData> {
|
|
154
153
|
if (!assetProperty) {
|
|
155
|
-
|
|
154
|
+
FW.Log.error(`加载资源失败,请检查参数列表:${assetProperty}!`);
|
|
156
155
|
return undefined;
|
|
157
156
|
}
|
|
158
157
|
const bundleName = assetProperty.bundle || FW.Entry.bundleName;
|
|
@@ -163,19 +162,19 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
163
162
|
const autoRelease = assetProperty.autoRelease;
|
|
164
163
|
|
|
165
164
|
if (!bundleName || bundleName === '') {
|
|
166
|
-
|
|
165
|
+
FW.Log.error(`找不到bundle${bundleName},或者bundle未加载!`);
|
|
167
166
|
return undefined;
|
|
168
167
|
}
|
|
169
168
|
|
|
170
169
|
if (!path || path === '') {
|
|
171
|
-
|
|
170
|
+
FW.Log.error(`找不到资源路径${path},请检查!`);
|
|
172
171
|
return undefined;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
let bundle: cc.AssetManager.Bundle = await this.resMgr.loadBundle(bundleName);
|
|
176
175
|
|
|
177
176
|
if (!bundle) {
|
|
178
|
-
|
|
177
|
+
FW.Log.error(`加载bundle失败,请检查!`);
|
|
179
178
|
return undefined;
|
|
180
179
|
}
|
|
181
180
|
const key = this.createAssetMapKey(assetProperty);
|
|
@@ -230,7 +229,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
230
229
|
*/
|
|
231
230
|
async loadDir(assetProperty: FW.AssetProperty): Promise<FW.AssetData[]> {
|
|
232
231
|
if (!assetProperty) {
|
|
233
|
-
|
|
232
|
+
FW.Log.error(`加载资源失败,请检查参数列表:${assetProperty}!`);
|
|
234
233
|
return undefined;
|
|
235
234
|
}
|
|
236
235
|
const bundleName = assetProperty.bundle || FW.Entry.bundleName;
|
|
@@ -240,19 +239,19 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
240
239
|
const autoRelease = assetProperty.autoRelease;
|
|
241
240
|
|
|
242
241
|
if (!bundleName || bundleName === '') {
|
|
243
|
-
|
|
242
|
+
FW.Log.error(`找不到bundle${bundleName},或者bundle未加载!`);
|
|
244
243
|
return undefined;
|
|
245
244
|
}
|
|
246
245
|
|
|
247
246
|
if (!path || path === '') {
|
|
248
|
-
|
|
247
|
+
FW.Log.error(`找不到资源路径${path},请检查!`);
|
|
249
248
|
return undefined;
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
const bundle: cc.AssetManager.Bundle = await this.resMgr.loadBundle(bundleName);
|
|
253
252
|
|
|
254
253
|
if (!bundle) {
|
|
255
|
-
|
|
254
|
+
FW.Log.error(`加载bundle失败,请检查!`);
|
|
256
255
|
return undefined;
|
|
257
256
|
}
|
|
258
257
|
|
|
@@ -263,7 +262,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
263
262
|
) => {
|
|
264
263
|
bundle.loadDir(path, type, (err: Error, assets: cc.Asset[]) => {
|
|
265
264
|
if (err || assets.length === 0) {
|
|
266
|
-
|
|
265
|
+
FW.Log.error(`加载资源失败:${assets},请检查!`);
|
|
267
266
|
reject(err);
|
|
268
267
|
}
|
|
269
268
|
|
|
@@ -303,24 +302,24 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
303
302
|
*/
|
|
304
303
|
get(assetProperty: FW.AssetProperty): FW.AssetData {
|
|
305
304
|
if (!assetProperty) {
|
|
306
|
-
|
|
305
|
+
FW.Log.error(`加载资源失败,请检查参数列表:${assetProperty}!`);
|
|
307
306
|
return undefined;
|
|
308
307
|
}
|
|
309
308
|
const bundleName = assetProperty.bundle || FW.Entry.bundleName;
|
|
310
309
|
const path = assetProperty.path;
|
|
311
310
|
|
|
312
311
|
if (!bundleName || bundleName === '') {
|
|
313
|
-
|
|
312
|
+
FW.Log.error(`找不到bundle${bundleName},或者bundle未加载!`);
|
|
314
313
|
return undefined;
|
|
315
314
|
}
|
|
316
315
|
|
|
317
316
|
if (!path || path === '') {
|
|
318
|
-
|
|
317
|
+
FW.Log.error(`找不到资源路径${path},请检查!`);
|
|
319
318
|
return undefined;
|
|
320
319
|
}
|
|
321
320
|
|
|
322
321
|
if (!this.has(assetProperty)) {
|
|
323
|
-
|
|
322
|
+
FW.Log.error('获取资源失败,请先加载!');
|
|
324
323
|
return undefined;
|
|
325
324
|
}
|
|
326
325
|
|
|
@@ -337,7 +336,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
337
336
|
*/
|
|
338
337
|
release(assetProperty: FW.AssetProperty): void {
|
|
339
338
|
if (!assetProperty) {
|
|
340
|
-
|
|
339
|
+
FW.Log.error(`加载资源失败,请检查参数列表:${assetProperty}!`);
|
|
341
340
|
return undefined;
|
|
342
341
|
}
|
|
343
342
|
const bundleName = assetProperty.bundle || FW.Entry.bundleName;
|
|
@@ -345,12 +344,12 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
345
344
|
const autoRelease = assetProperty.autoRelease;
|
|
346
345
|
|
|
347
346
|
if (!bundleName || bundleName === '') {
|
|
348
|
-
|
|
347
|
+
FW.Log.error(`找不到bundle${bundleName},或者bundle未加载!`);
|
|
349
348
|
return undefined;
|
|
350
349
|
}
|
|
351
350
|
|
|
352
351
|
if (!path || path === '') {
|
|
353
|
-
|
|
352
|
+
FW.Log.error(`找不到资源路径${path},请检查!`);
|
|
354
353
|
return undefined;
|
|
355
354
|
}
|
|
356
355
|
|
|
@@ -384,7 +383,7 @@ export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
|
384
383
|
*/
|
|
385
384
|
has(assetProperty: FW.AssetProperty) {
|
|
386
385
|
if (!assetProperty) {
|
|
387
|
-
|
|
386
|
+
FW.Log.error(`判断资源是否存在失败,请检查参数列表:${assetProperty}!`);
|
|
388
387
|
return;
|
|
389
388
|
}
|
|
390
389
|
|