refactor(渲染): 重构实体层级管理方式
- 移除通过 setSiblingIndex 手动设置层级的方式 - 新增 HERO、LINE1、LINE2、SKILL 等容器节点自动管理层级 - 调整英雄、怪物、技能等实体的父节点到对应容器 - 优化提示信息的位置偏移量
This commit is contained in:
@@ -293,10 +293,10 @@ export class HeroMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
||||
});
|
||||
|
||||
// 设置渲染顺序:x坐标越大的显示在上层(index越大,层级越高)
|
||||
sortedUnits.forEach((unit, index) => {
|
||||
const model = unit.get(HeroViewComp);
|
||||
model.node.setSiblingIndex(index); // 直接使用index,x坐标大的index大,层级高
|
||||
});
|
||||
// sortedUnits.forEach((unit, index) => {
|
||||
// const model = unit.get(HeroViewComp);
|
||||
// model.node.setSiblingIndex(index); // 直接使用index,x坐标大的index大,层级高
|
||||
// });
|
||||
}
|
||||
|
||||
/** 检查指定位置是否已被占用 */
|
||||
|
||||
Reference in New Issue
Block a user