引导系统基本完成,开始制作 引导步骤
This commit is contained in:
@@ -9,7 +9,7 @@ const { ccclass, property } = _decorator;
|
||||
export class HeroSelectCom extends Component {
|
||||
slot:number=0
|
||||
start() {
|
||||
|
||||
console.log("[HeroSelectCom]:start",this.node)
|
||||
}
|
||||
onAdded(args: any) {
|
||||
// console.log("[HeroSelectCom]:onAdded",args)
|
||||
@@ -29,7 +29,7 @@ export class HeroSelectCom extends Component {
|
||||
let hero=heros[i]
|
||||
// console.log("[HeroPageComp]:hero",hero)
|
||||
if(hero){
|
||||
this.load_hero(hero)
|
||||
this.load_hero(hero,i)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export class HeroSelectCom extends Component {
|
||||
children[i].destroy()
|
||||
}
|
||||
}
|
||||
load_hero(uuid:number){
|
||||
load_hero(uuid:number,index:number){
|
||||
// console.log("[HeroPageComp]:load_hero",uuid)
|
||||
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||
let path = "game/gui/hcard"
|
||||
@@ -52,6 +52,7 @@ export class HeroSelectCom extends Component {
|
||||
return;
|
||||
}
|
||||
const node = instantiate(prefab) as unknown as Node;
|
||||
node.name="hero"+index.toString()
|
||||
node.parent = parent;
|
||||
let hcard = node.getComponent(HCardUICom)!;
|
||||
hcard.update_data(uuid,{type:HeroConSet.SELECT,slot:this.slot})
|
||||
|
||||
Reference in New Issue
Block a user