dd
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,ProgressBar,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
|
||||
import { _decorator,Button,Color,EventHandler,EventTouch,Label,NodeEventType,ProgressBar,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { ColorSet } from "../common/config/BoxSet";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -35,7 +37,18 @@ export class HCardComp extends CCComp {
|
||||
this.pw=this.node.getChildByName("pow").getComponent(ProgressBar)!
|
||||
this.hc_name.string= this.heros[this.hi].HeroView.hero_name
|
||||
// this.node.getChildByName("lv").getComponent(Label).string=this.heros[this.hi].HeroView.lv.toString()+"级";
|
||||
console.log("hcard start")
|
||||
// console.log("hcard start",this.heros[this.hi].HeroView.hero_uuid)
|
||||
switch(HeroInfo[this.heros[this.hi].HeroView.hero_uuid].quality){
|
||||
case 1:
|
||||
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
|
||||
break;
|
||||
case 2:
|
||||
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
|
||||
break;
|
||||
case 3:
|
||||
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(this.is_dead) return
|
||||
@@ -53,6 +66,7 @@ export class HCardComp extends CCComp {
|
||||
this.life.progress=this.heros[this.hi].HeroView.hp/this.heros[this.hi].HeroView.rhp_max
|
||||
this.pw.progress=this.heros[this.hi].HeroView.pw/this.heros[this.hi].HeroView.pwm
|
||||
|
||||
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user