手机测试卡,需要解决
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, v3, Vec3 } from 'cc';
|
||||
import { HeroViewComp } from './HeroViewComp';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { Tooltip } from '../skills/Tooltip';
|
||||
@@ -10,7 +9,6 @@ const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('BuffComp')
|
||||
export class BuffComp extends Component {
|
||||
heroView: any=null;
|
||||
ap_node:any=null;
|
||||
cd_node:any=null;
|
||||
def_node:any=null;
|
||||
@@ -33,7 +31,6 @@ export class BuffComp extends Component {
|
||||
speek_time:number=0;
|
||||
|
||||
start() {
|
||||
this.heroView = this.node.getComponent(HeroViewComp);
|
||||
// this.buff_get("dodge")
|
||||
// this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
|
||||
// this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
|
||||
@@ -56,16 +53,12 @@ export class BuffComp extends Component {
|
||||
this.node.getChildByName("buff").active = false;
|
||||
}
|
||||
|
||||
this.hp_show()
|
||||
this.in_speek(deltaTime)
|
||||
if(this.heroView.shield > 0){
|
||||
this.node.getChildByName("shielded").active=true
|
||||
}else{
|
||||
this.node.getChildByName("shielded").active=false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
show_shield(val:boolean){
|
||||
this.node.getChildByName("shielded").active=val
|
||||
}
|
||||
buff_get(name:string){
|
||||
var path = "game/skills/buffget/buffget";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
@@ -86,16 +79,7 @@ export class BuffComp extends Component {
|
||||
this.node.getChildByName("buff").active = true;
|
||||
}
|
||||
|
||||
hp_show(){
|
||||
let hp_progress= this.heroView.hp/this.heroView.rhp_max;
|
||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
|
||||
if(this.heroView.is_boss) return
|
||||
if(this.heroView.hp == this.heroView.rhp_max){
|
||||
this.node.getChildByName("top").getChildByName("hp").active = false;
|
||||
} else{
|
||||
this.node.getChildByName("top").getChildByName("hp").active = true;
|
||||
}
|
||||
}
|
||||
|
||||
max_show(){
|
||||
this.node.getChildByName("max").active=true
|
||||
this.scheduleOnce(()=>{
|
||||
|
||||
Reference in New Issue
Block a user