英雄出战选择 +英雄相关 ui 改变
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user