feat(渲染): 实现基于线路和生成顺序的层级管理系统

添加IndexSet枚举定义基础层级和增量
修改怪物生成逻辑以支持线路(lane)和生成顺序(spawnOrder)
重构MonMoveSystem中的渲染层级更新逻辑
优化HeroViewComp中血条显示逻辑
调整怪物位置配置以支持双线路布局
This commit is contained in:
2025-11-03 06:38:06 +08:00
parent 1f5792aa99
commit 2a309a14d0
6 changed files with 96 additions and 36 deletions

View File

@@ -112,6 +112,7 @@ export class HeroViewComp extends CCComp {
/** 显示护盾 */
private show_shield(shield: number = 0, shield_max: number = 0) {
if(!this.top_node.active) return
let shield_progress = shield / shield_max;
this.node.getChildByName("shielded").active = shield > 0;
this.top_node.getChildByName("shield").active = shield > 0;
@@ -123,6 +124,11 @@ export class HeroViewComp extends CCComp {
/** 显示血量 */
private hp_show(hp: number, hp_max: number) {
if(hp==hp_max) {
this.top_node.active=false;
return
}
this.top_node.active=true
let hp_progress = hp / hp_max;
this.top_node.getChildByName("hp").getComponent(ProgressBar).progress = hp_progress;
this.scheduleOnce(() => {
@@ -132,12 +138,14 @@ export class HeroViewComp extends CCComp {
/** 显示魔法值 */
private mp_show(mp: number, mp_max: number) {
if(!this.top_node.active) return
this.top_node.getChildByName("mp").getComponent(ProgressBar).progress = mp / mp_max;
this.scheduleOnce(() => {
this.top_node.getChildByName("mp").getChildByName("mpb").getComponent(ProgressBar).progress = mp / mp_max;
}, 0.15);
}
private pow_show(pow: number, pow_max: number) {
if(!this.top_node.active) return
this.top_node.getChildByName("pow").getComponent(ProgressBar).progress = pow / pow_max;
this.scheduleOnce(() => {
this.top_node.getChildByName("pow").getChildByName("mpb").getComponent(ProgressBar).progress = pow / pow_max;