Files
heros/assets/script/game/map/HeroPageComp.ts
panw 22726eed3b fix(skills): 修正技能预制体锚点并添加调试日志
- 将atk1和atk2技能预制体的锚点y值从0.5改为0
- 在SkillConComp中加载技能时添加uuid为6001时的起始坐标日志输出
- 在Skill加载函数中,uuid为6001时输出加载起始坐标日志
- 在SkillCom组件中,uuid为6001时输出起始位置日志
- 删除HeroPageComp中load_hero函数的实现内容,保留函数体
- 修正Skill加载时节点父级赋值逻辑,确保正确设置父节点
2025-10-13 13:27:40 +08:00

49 lines
1.6 KiB
TypeScript

import { _decorator, Component, instantiate, Node, Prefab, UITransform } from 'cc';
import { smc } from '../common/SingletonModuleComp';
import { oops } from 'db://oops-framework/core/Oops';
import { HeroConSet } from '../common/config/BoxSet';
import { getHeroList } from '../common/config/heroSet';
const { ccclass, property } = _decorator;
@ccclass('HeroPageComp')
export class HeroPageComp extends Component {
start() {
// console.log("[HeroPageComp]:start")
}
update(deltaTime: number) {
}
onEnable(){
this.update_heros()
}
update_heros(){
let heros=getHeroList()
// console.log("[HeroPageComp]:update_heros",heros)
let height= Math.ceil(heros.length/3)*315+30
this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform).setContentSize(720,height)
// console.log("[HeroPageComp]:UITransform height",this.node.getChildByName("main").getChildByName("view").getChildByName("heros").getComponent(UITransform))
this.clear_heros()
for(let i=0;i<heros.length;i++){
let hero=heros[i]
if(hero){
this.load_hero(hero)
}
}
}
load_hero(uuid:number){
}
clear_heros(){
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
let children=parent.children
// console.log("[HeroPageComp]:clear_heros",children)
for(let i=0;i<children.length;i++){
children[i].destroy()
}
}
}