fix: 修复合成规则默认值和进度条组件类型错误
- 将 MissionCardComp 中的合成规则默认值改为从 FightSet 配置读取,避免硬编码 - 修复 VictoryComp 中进度条组件类型错误,将 Sprite 改为 ProgressBar 并更新属性设置
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* - ScoreWeights(ScoreSet)—— 得分权重配置
|
||||
* - GameEvent.MissionEnd / MissionStart —— 游戏生命周期事件
|
||||
*/
|
||||
import { _decorator, instantiate, Label ,Prefab,Node, Sprite, Animation, AnimationClip, resources, UITransform, Widget } from "cc";
|
||||
import { _decorator, instantiate, Label ,Prefab,Node, Sprite, Animation, AnimationClip, resources, UITransform, Widget, ProgressBar } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
@@ -418,12 +418,12 @@ export class VictoryComp extends CCComp {
|
||||
const lab = node.getChildByName("score_label")?.getComponent(Label);
|
||||
if (lab) lab.string = `${score}`;
|
||||
|
||||
const bar = node.getChildByName("progress_bar")?.getComponent(Sprite);
|
||||
const bar = node.getChildByName("progress_bar")?.getComponent(ProgressBar);
|
||||
if (bar) {
|
||||
// 根据该维度得分占“预期满分”的比例设置进度条(fillRange)
|
||||
bar.fillRange = Math.min(1, Math.max(0, score / maxScore));
|
||||
bar.progress = Math.min(1, Math.max(0, score / maxScore));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// TODO: 进度条的最大值可按设计期望自行调整,目前为占位预估值
|
||||
renderDim(this.combat_node, s.score_combat, 3000);
|
||||
|
||||
Reference in New Issue
Block a user