英雄出战选择 +英雄相关 ui 改变

This commit is contained in:
2025-08-17 20:40:03 +08:00
parent ba61724a08
commit 1a25a566c8
20 changed files with 6674 additions and 2240 deletions

View File

@@ -1,7 +1,9 @@
import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
import { _decorator, Component, instantiate, Node, Prefab, UITransform } from 'cc';
import { smc } from '../common/SingletonModuleComp';
import { oops } from 'db://oops-framework/core/Oops';
import { HCardUICom } from './HCardUICom';
import { HeroConSet } from '../common/config/BoxSet';
import { getHeroList } from '../common/config/heroSet';
const { ccclass, property } = _decorator;
@ccclass('HeroPageComp')
@@ -14,10 +16,12 @@ export class HeroPageComp extends Component {
}
update_heros(){
let heros=smc.getHasHeroUUID()
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).height=height
this.clear_heros()
for(let i=0;i<3;i++){
for(let i=0;i<heros.length;i++){
let hero=heros[i]
console.log("[HeroPageComp]:hero",hero)
if(hero){
@@ -37,7 +41,7 @@ export class HeroPageComp extends Component {
const node = instantiate(prefab);
node.parent=parent
let hcard=node.getComponent(HCardUICom)!
hcard.update_data(uuid)
hcard.update_data(uuid,{type:HeroConSet.INFO})
}
clear_heros(){
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")