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

@@ -8,6 +8,7 @@ import { GameEvent } from "../common/config/GameEvent";
// 导入肉鸽配置
import { MonType, EventType, getStageMonConfigs} from "./RogueConfig";
import { BuffConf } from "../common/config/SkillSet";
import { IndexSet } from "../common/config/GameSet";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -30,6 +31,8 @@ export class MissionMonCompComp extends CCComp {
private isPausing: boolean = false; // 是否正在暂停
private currentEvent: EventType | null = null; // 当前关卡的随机事件
private eventProcessed: boolean = false; // 事件是否已处理
/** 全局生成顺序计数器,用于层级管理 */
private globalSpawnOrder: number = 0;
onLoad(){
@@ -46,6 +49,8 @@ export class MissionMonCompComp extends CCComp {
fight_ready(){
// console.log("[MissionMonComp]:fight_ready")
smc.vmdata.mission_data.mon_num=0
// 重置生成顺序计数器
this.globalSpawnOrder = 0
this.do_mon_wave()
}
@@ -185,8 +190,14 @@ export class MissionMonCompComp extends CCComp {
let scale = -1;
let pos: Vec3 = v3(MonSet[i].pos);
// 生成怪物
mon.load(pos,scale,uuid,lv,monType,buffs);
// 根据位置判断线路y=110为一线(lane=0)y=80为二线(lane=1)
const lane = pos.y === 110 ? 0 : 1;
// 递增全局生成顺序
this.globalSpawnOrder++;
// 生成怪物,传递线路和生成顺序
mon.load(pos, scale, uuid, lv, monType, buffs, false, lane, this.globalSpawnOrder);
}