再次清理英雄,切换到像素
This commit is contained in:
@@ -32,8 +32,6 @@ export class BuffComp extends Component {
|
||||
buff_cd:number=0;
|
||||
wind_cd:number=0;
|
||||
speek_time:number=0;
|
||||
HeroView:HeroViewComp=null!
|
||||
hp_bar:any=null
|
||||
|
||||
timer:Timer=new Timer(2);
|
||||
buff_keys:any[]=["by1","by2","by3"]
|
||||
@@ -45,11 +43,9 @@ export class BuffComp extends Component {
|
||||
}
|
||||
|
||||
info_init(){
|
||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||
this.top_node = this.node.getChildByName("top");
|
||||
let hp_y=this.node.getComponent(UITransform).height
|
||||
this.top_node.setPosition(0,hp_y,0)
|
||||
this.hp_bar=this.top_node.getChildByName("hp").getComponent(ProgressBar)
|
||||
// this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false)
|
||||
|
||||
// this.vmdata_update()
|
||||
@@ -60,7 +56,7 @@ export class BuffComp extends Component {
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
this.hp_show()
|
||||
|
||||
if(this.wind_cd > 0 ) this.wind_cd -= deltaTime;
|
||||
if(this.wind_cd <= 0 && this.node.getChildByName("wind").active){
|
||||
this.node.getChildByName("wind").active = false;
|
||||
@@ -75,15 +71,7 @@ export class BuffComp extends Component {
|
||||
// this.in_speek(deltaTime)
|
||||
// this.vmdata_update()
|
||||
}
|
||||
hp_show(){
|
||||
// if(this.node.getComponent(HeroViewComp).fac == 0) return
|
||||
let hp=this.HeroView.currentHp;
|
||||
let hp_max=this.HeroView.currentHpMax;
|
||||
let hp_progress= hp/hp_max;
|
||||
this.hp_bar.progress = hp_progress;
|
||||
if(this.HeroView.is_boss) return
|
||||
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
|
||||
}
|
||||
|
||||
show_shield(val:boolean){
|
||||
this.node.getChildByName("shielded").active=val
|
||||
}
|
||||
@@ -133,20 +121,20 @@ export class BuffComp extends Component {
|
||||
var path = "game/skills/dead";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setScale(node.scale.x*0.5,node.scale.y*0.5)
|
||||
let pos = v3(this.node.position.x,this.node.position.y+30,this.node.position.z);
|
||||
node.parent = this.node.parent;
|
||||
node.setPosition(pos);
|
||||
}
|
||||
in_atked(anm:string="atked") {
|
||||
in_atked(anm:string="atked",scale:number=1) {
|
||||
var path = "game/skills/"+anm;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
let pos =v3(15,30);
|
||||
node.setPosition(pos)
|
||||
node.parent = this.node;
|
||||
node.setScale(node.scale.x*scale,node.scale.y)
|
||||
node.setPosition(this.node.position.x,this.node.position.y+30,this.node.position.z)
|
||||
node.parent = this.node.parent;
|
||||
}
|
||||
in_iced(t:number=1,ap:number=0) {
|
||||
console.log("[buffcomp]:in_iced",this.HeroView.hero_name,t,ap)
|
||||
var path = "game/skills/iced";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
@@ -166,7 +154,8 @@ export class BuffComp extends Component {
|
||||
var path = "game/skills/yun";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setPosition(v3(0,0));
|
||||
let height=this.node.getComponent(UITransform).height
|
||||
node.setPosition(v3(0,height));
|
||||
node.getComponent(timedCom).time = t;
|
||||
node.getComponent(timedCom).ap = ap;
|
||||
node.parent = this.node;
|
||||
|
||||
Reference in New Issue
Block a user