feat(渲染): 重构渲染层级管理并添加BOSS层级
移除动态渲染层级更新逻辑,改为在实体加载时设置固定层级 - 在Hero和Monster的load方法中设置初始siblingIndex - 添加BOSS枚举值到IndexSet - 为Monster添加溢出保护,防止层级索引过大 - 删除墓地位置判断等不再需要的逻辑
This commit is contained in:
@@ -193,8 +193,8 @@ export class MissionMonCompComp extends CCComp {
|
||||
// 根据位置判断线路:y=110为一线(lane=0),y=80为二线(lane=1)
|
||||
const lane = pos.y === 110 ? 0 : 1;
|
||||
|
||||
// 递增全局生成顺序
|
||||
this.globalSpawnOrder++;
|
||||
// 递增全局生成顺序 - 🔥 添加溢出保护
|
||||
this.globalSpawnOrder = (this.globalSpawnOrder + 1) % 999; // 防止无限增长,在999处循环重置
|
||||
|
||||
// 生成怪物,传递线路和生成顺序
|
||||
mon.load(pos, scale, uuid, lv, monType, buffs, false, lane, this.globalSpawnOrder);
|
||||
|
||||
Reference in New Issue
Block a user