refactor(渲染): 重构实体层级管理方式

- 移除通过 setSiblingIndex 手动设置层级的方式
- 新增 HERO、LINE1、LINE2、SKILL 等容器节点自动管理层级
- 调整英雄、怪物、技能等实体的父节点到对应容器
- 优化提示信息的位置偏移量
This commit is contained in:
2025-11-04 14:23:07 +08:00
parent 1e0537b63d
commit 087f4010be
7 changed files with 419 additions and 59 deletions

View File

@@ -8,6 +8,7 @@ import { SkillView } from "./SkillView";
import { SDataCom } from "./SDataCom";
import { SMoveDataComp } from "../skill/SMoveComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { smc } from "../common/SingletonModuleComp";
/** Skill 模块 */
@ecs.register(`Skill`)
@@ -46,7 +47,8 @@ export class Skill extends ecs.Entity {
// console.log("load skill startPos",startPos)
const node: Node = instantiate(prefab);
// console.log("load skill node",node)
node.parent = parent;
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!.getChildByName("SKILL")!;
// 设置节点属性
node.setPosition(startPos);