升级初步完成
This commit is contained in:
@@ -54,7 +54,7 @@ export class Hero extends ecs.Entity {
|
||||
this.addComponents<ecs.Comp>( MonModelComp);
|
||||
}
|
||||
|
||||
var path = "game/heros/"+smc.heros[uuid].path;
|
||||
var path = "game/heros/"+HeroInfo[uuid].path;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
|
||||
@@ -69,9 +69,9 @@ export class Hero extends ecs.Entity {
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO){
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
// console.log("hero_init",buff)
|
||||
let HInf= smc.heros[uuid] // 角色数据
|
||||
let HInf= HeroInfo[uuid] // 角色数据
|
||||
let talent= smc.vmdata.talent
|
||||
let hero =smc.vmdata.heros[uuid]
|
||||
let hero =smc.heros[uuid]
|
||||
let talents=Talents;
|
||||
hv.scale = scale;
|
||||
hv.box_group = box_group;
|
||||
@@ -112,7 +112,7 @@ export class Hero extends ecs.Entity {
|
||||
}
|
||||
set_ratio(uuid:number){
|
||||
let ratio=1;
|
||||
switch (smc.heros[uuid].level) {
|
||||
switch (HeroInfo[uuid].level) {
|
||||
case 2:
|
||||
ratio=1.05
|
||||
break;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { HeroCardComp } from "./HeroCardComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
|
||||
/** HeroCard 模块 */
|
||||
@ecs.register(`HeroCard`)
|
||||
@@ -18,17 +19,17 @@ export class HeroCard extends ecs.Entity {
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = parent;
|
||||
node.getChildByName("name").getComponent(Label).string = smc.heros[uuid].name
|
||||
node.getChildByName("name").getComponent(Label).string = HeroInfo[uuid].name
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(smc.heros[uuid].path);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
|
||||
});
|
||||
node.getChildByName("lv").getComponent(Label).string = smc.vmdata.heros[uuid].lv.toString();
|
||||
if(smc.vmdata.heros[uuid].slv>=1) node.getChildByName("slv").getChildByName("s1").active=true;
|
||||
if(smc.vmdata.heros[uuid].slv>=2) node.getChildByName("slv").getChildByName("s2").active=true;
|
||||
if(smc.vmdata.heros[uuid].slv>=3) node.getChildByName("slv").getChildByName("s3").active=true;
|
||||
if(smc.vmdata.heros[uuid].slv>=4) node.getChildByName("slv").getChildByName("s4").active=true;
|
||||
if(smc.vmdata.heros[uuid].slv>=5) node.getChildByName("slv").getChildByName("s5").active=true;
|
||||
node.getChildByName("lv").getComponent(Label).string = smc.heros[uuid].lv.toString();
|
||||
if(smc.heros[uuid].slv>=1) node.getChildByName("slv").getChildByName("s1").active=true;
|
||||
if(smc.heros[uuid].slv>=2) node.getChildByName("slv").getChildByName("s2").active=true;
|
||||
if(smc.heros[uuid].slv>=3) node.getChildByName("slv").getChildByName("s3").active=true;
|
||||
if(smc.heros[uuid].slv>=4) node.getChildByName("slv").getChildByName("s4").active=true;
|
||||
if(smc.heros[uuid].slv>=5) node.getChildByName("slv").getChildByName("s5").active=true;
|
||||
let hcc = node.getComponent(HeroCardComp)!;
|
||||
hcc.hcc_uuid = uuid;
|
||||
this.add(hcc);
|
||||
|
||||
Reference in New Issue
Block a user