dd
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
import { _decorator, v3, Vec3 } from "cc";
|
import { _decorator, Sprite, SpriteFrame, v3, Vec3 } from "cc";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { BoxSet, GameSet } from "../common/config/BoxSet";
|
import { BoxSet, GameSet } from "../common/config/BoxSet";
|
||||||
@@ -10,6 +10,7 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||||
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -44,10 +45,21 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
show_heros_pos(event: string, args: any){
|
show_heros_pos(event: string, args: any){
|
||||||
console.log("show_heros_pos",args)
|
console.log("show_heros_pos",args)
|
||||||
|
|
||||||
this.current_hero_uuid=args.uuid
|
this.current_hero_uuid=args.uuid
|
||||||
|
this.update_fight_hero_info()
|
||||||
this.node.getChildByName("herospos").active=true
|
this.node.getChildByName("herospos").active=true
|
||||||
}
|
}
|
||||||
|
update_fight_hero_info(){
|
||||||
|
let heros=ecs.query(ecs.allOf(HeroModelComp))
|
||||||
|
for(let hero of heros){
|
||||||
|
let hv = hero.get(HeroViewComp)
|
||||||
|
if(hv.fight_pos==0){
|
||||||
|
let icon=this.node.getChildByName("herospos").getChildByName("heropos1").getChildByName("hero").getChildByName("icon")
|
||||||
|
let icon_frame=oops.res.get(HeroInfo[hv.hero_uuid].icon,SpriteFrame)!
|
||||||
|
icon.getComponent(Sprite).spriteFrame=icon_frame
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
call_hero(event: string, args: any){
|
call_hero(event: string, args: any){
|
||||||
this.node.getChildByName("herospos").active=false
|
this.node.getChildByName("herospos").active=false
|
||||||
console.log("call_hero",args)
|
console.log("call_hero",args)
|
||||||
@@ -63,16 +75,12 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
/** 添加玩家 */
|
/** 添加玩家 */
|
||||||
private addHero(uuid:number=1001,fight_pos:number=0) {
|
private addHero(uuid:number=1001,fight_pos:number=0) {
|
||||||
console.log("call_hero addHero",uuid)
|
console.log("call_hero addHero",uuid)
|
||||||
let info:any={ap:0,hp:0}
|
let info:any=this.get_info_and_remove(fight_pos,uuid)
|
||||||
if(this.start_pos[fight_pos].has){
|
|
||||||
info=this.get_info_and_remove(fight_pos,uuid)
|
|
||||||
}
|
|
||||||
let hero = ecs.getEntity<Hero>(Hero);
|
let hero = ecs.getEntity<Hero>(Hero);
|
||||||
let scale = 1
|
let scale = 1
|
||||||
let pos:Vec3 = this.start_pos[fight_pos].pos;
|
let pos:Vec3 = this.start_pos[fight_pos].pos;
|
||||||
console.log("hero load0",pos,this.start_pos)
|
console.log("hero load0",pos,this.start_pos)
|
||||||
hero.load(pos,scale,uuid,info,fight_pos);
|
hero.load(pos,scale,uuid,info,fight_pos);
|
||||||
this.start_pos[fight_pos].has=true
|
|
||||||
this.current_hero_uuid=0
|
this.current_hero_uuid=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user