@cc-component/cc-core 1.0.7 → 1.0.8
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.
|
@@ -3,7 +3,7 @@ import { _decorator, CCString, Component, Enum, instantiate, Node, Prefab } from
|
|
|
3
3
|
import { ISceneParam } from '../interface/ISceneParam';
|
|
4
4
|
import { DEBUG } from 'cc/env';
|
|
5
5
|
import { ResourceManager } from './ResourceManager';
|
|
6
|
-
import { ProgessView } from './
|
|
6
|
+
import { ProgessView } from './ProgessWindow';
|
|
7
7
|
import { AssetType, BundleConfig, BundleConfigName, GetAssetType } from '../config/CommonEnum';
|
|
8
8
|
import { LanguageData } from '../lib/language/LanguageData';
|
|
9
9
|
const { ccclass, property } = _decorator;
|
|
@@ -16,16 +16,17 @@ const { ccclass, property, menu } = _decorator;
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
@ccclass('
|
|
20
|
-
@menu('组件进度条/
|
|
21
|
-
export class
|
|
19
|
+
@ccclass('ProgessWindow')
|
|
20
|
+
@menu('组件进度条/ProgessWindow')
|
|
21
|
+
export class ProgessWindow extends Component {
|
|
22
22
|
|
|
23
|
-
// static Ins:
|
|
23
|
+
// static Ins:ProgessWindow;
|
|
24
24
|
@property({
|
|
25
25
|
type: ProgressBar,
|
|
26
26
|
displayName: "进度条"
|
|
27
27
|
})
|
|
28
28
|
pro_bar!: ProgressBar;
|
|
29
|
+
stop = false
|
|
29
30
|
|
|
30
31
|
protected onLoad(): void {
|
|
31
32
|
|
|
@@ -35,33 +36,29 @@ export class ProgessView extends Component {
|
|
|
35
36
|
this.pro_bar.node.active = isShow
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
async
|
|
39
|
+
/***更新进度--假的进度 */
|
|
40
|
+
async ProgessValueAuto(isOk) {
|
|
40
41
|
this.stop = isOk
|
|
41
42
|
if (isOk) {
|
|
42
43
|
for (var i = 90; i < 101; i++) {
|
|
43
44
|
await MainModule.timeManager.AwaitMS(1);
|
|
44
|
-
this.
|
|
45
|
+
this.ProgessValue((i));
|
|
45
46
|
}
|
|
46
47
|
this.Hide()
|
|
47
48
|
} else {
|
|
48
49
|
for (var i = 0; i < 90; i++) {
|
|
49
50
|
if (this.stop) { return }
|
|
50
51
|
await MainModule.timeManager.AwaitMS(1);
|
|
51
|
-
this.
|
|
52
|
+
this.ProgessValue((i));
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
/***更新进度 */
|
|
58
|
+
public ProgessValue(value: number) {
|
|
57
59
|
if (this.pro_bar) {
|
|
58
|
-
this.pro_bar
|
|
59
|
-
// console.log(value);
|
|
60
|
-
if (value >= 100) {
|
|
61
|
-
// this.Hide();
|
|
62
|
-
}
|
|
60
|
+
this.pro(this.pro_bar, value, 100);
|
|
63
61
|
}
|
|
64
|
-
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
Show() {
|
|
@@ -73,24 +70,19 @@ export class ProgessView extends Component {
|
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
|
|
76
|
-
pro(
|
|
77
|
-
|
|
78
|
-
const com_max_pro = this.totalLength//getComponent(UITransform).width
|
|
73
|
+
pro(proBar: ProgressBar, progress: number, max: number, anim_time?: number): void {
|
|
74
|
+
const com_max_pro = proBar.totalLength//getComponent(UITransform).width
|
|
79
75
|
const max_progress = com_max_pro;
|
|
80
76
|
const s = max_progress / max;
|
|
81
77
|
const pro = progress * s / max_progress;
|
|
82
|
-
|
|
83
78
|
if (anim_time) {
|
|
84
|
-
tween(
|
|
79
|
+
tween(proBar).to(anim_time, {
|
|
85
80
|
progress: pro
|
|
86
81
|
}).start();
|
|
87
82
|
|
|
88
83
|
} else {
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
proBar.progress = pro;
|
|
91
85
|
}
|
|
92
86
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
87
|
}
|
|
96
88
|
|
package/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export * from './assets/core/config/IConfig';
|
|
|
8
8
|
//基类
|
|
9
9
|
export * from './assets/core/home/BaseLaunchComponent';
|
|
10
10
|
export * from './assets/core/home/BaseLoading';
|
|
11
|
-
export * from './assets/core/home/
|
|
11
|
+
export * from './assets/core/home/ProgessWindow';
|
|
12
12
|
//日志
|
|
13
13
|
export * from './assets/core/lib/logger/ELoggerLevel';
|
|
14
14
|
|
package/package.json
CHANGED
|
File without changes
|