feat(game): 为技能配置添加类型字段并完善信息框交互
- 在 SkillSet 中新增 IType 枚举定义技能类型(近战/远程/辅助) - 为所有技能配置添加 IType 字段 - 在 IBoxComp 中添加英雄名称显示和点击关闭功能
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -93,6 +93,11 @@ export enum DType {
|
||||
WIND=3, // 风元素
|
||||
}
|
||||
|
||||
export enum IType {
|
||||
Melee = 0, // 近战
|
||||
remote = 1, // 远程
|
||||
support = 2, // 辅助
|
||||
}
|
||||
export const HeroSkillList = [6001,6001,6001,6001,6001,6001]
|
||||
|
||||
// Debuff配置接口
|
||||
@@ -137,6 +142,7 @@ export interface SkillConfig {
|
||||
endAnm:string, // 结束动画名称
|
||||
EAnm:number, // 结束动画ID
|
||||
DAnm:string, // 命中后动画ID
|
||||
IType:IType, // 技能类型(近战/远程/辅助)
|
||||
RType:RType, // 技能运行类型(直线/贝塞尔/固定起点/固定终点)
|
||||
EType:EType, // 结束条件(动画结束/时间结束/距离结束/碰撞/次数结束)
|
||||
time?:number, // timeEnd 持续时间(秒)
|
||||
@@ -164,153 +170,153 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
// ========== 近战技能 ==========
|
||||
6001: {
|
||||
uuid:6001,name:"近战攻击",sp_name:"atk",icon:"1026",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.Melee,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个造成100%攻击的伤害",
|
||||
},
|
||||
//大招
|
||||
6002: {
|
||||
uuid:6002,name:"闪光攻击",sp_name:"atk_s2",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max",
|
||||
DTType:DTType.single,ap:150,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:150,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.Melee,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害",
|
||||
},
|
||||
6003: {
|
||||
uuid:6003,name:"火焰攻击",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
|
||||
DTType:DTType.single,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.Melee,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,击退率20%",
|
||||
},
|
||||
6004: {
|
||||
uuid:6004,name:"闪电攻击",sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
|
||||
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.Melee,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,暴击率20%",
|
||||
},
|
||||
6005: {
|
||||
uuid:6005,name:"半月攻击",sp_name:"atk_light",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:3,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:3,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.Melee,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"穿透多个目标造成100%攻击的伤害",
|
||||
},
|
||||
|
||||
//===============射手技能==================
|
||||
6101: {
|
||||
uuid:6101,name:"普通射击",sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
|
||||
},
|
||||
6102: {
|
||||
uuid:6102,name:"冰冻射击",sp_name:"arrow_blue",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
|
||||
},
|
||||
6103: {
|
||||
uuid:6103,name:"暴击射击",sp_name:"arrow_red",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
|
||||
},
|
||||
//大招
|
||||
6104: {
|
||||
uuid:6104,name:"闪光射击",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
|
||||
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对多个目标造成100%攻击的伤害,暴击",
|
||||
},
|
||||
|
||||
//===========魔法技能===========
|
||||
6201: {
|
||||
uuid:6201,name:"蓝波",sp_name:"ball_blue",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,frz:0,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,frz:0,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害,冰冻率20%",
|
||||
},
|
||||
6202: {
|
||||
uuid:6202,name:"绿波",sp_name:"ball_green",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
|
||||
},
|
||||
6203: {
|
||||
uuid:6203,name:"红波",sp_name:"ball_red",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
|
||||
},
|
||||
//大招
|
||||
6204: {
|
||||
uuid:6204,name:"火球",sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,bck:20,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,bck:20,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害,击退率20%",
|
||||
},
|
||||
6205: {
|
||||
uuid:6205,name:"月波",sp_name:"ball_gquan",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,ap:200,hit_count:6,hitcd:0.3,speed:300,with:90,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,ap:200,hit_count:6,hitcd:0.3,speed:300,with:90,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.linear,EType:EType.collision,buffs:[],info:"对多个目标造成200%攻击的伤害",
|
||||
},
|
||||
|
||||
6206: {
|
||||
uuid:6206,name:"陨石术",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
|
||||
DTType:DTType.range,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.range,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,暴击率20%",
|
||||
},
|
||||
6207: {
|
||||
uuid:6207,name:"冰刺",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max",
|
||||
DTType:DTType.range,frz:0,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.range,frz:0,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,冰冻率20%",
|
||||
},
|
||||
6208: {
|
||||
uuid:6208,name:"火墙",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
|
||||
DTType:DTType.range,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.range,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.remote,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,击退率20%",
|
||||
},
|
||||
|
||||
//============================= ====== 辅助技能 ====== ==========================
|
||||
6301:{
|
||||
uuid:6301,name:"魔法盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"获得3次伤害免疫",
|
||||
},
|
||||
6302: {
|
||||
uuid:6302,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:300,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:300,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"治疗1个友方300%攻击力的生命值",
|
||||
},
|
||||
6303:{
|
||||
uuid:6303,name:"护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机1个友方获得3次伤害免疫",
|
||||
},
|
||||
6304: {
|
||||
uuid:6304,name:"群体治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:200,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:200,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机治疗3个友方200%攻击力的生命值",
|
||||
},
|
||||
6305:{
|
||||
uuid:6305,name:"群体护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:2,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:2,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机3个友方获得2次伤害免疫",
|
||||
},
|
||||
//==========================buff 技能=====================
|
||||
6401:{
|
||||
uuid:6401,name:"单体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"ap_up",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5}],info:"随机1个友方+5攻击",
|
||||
},
|
||||
6402:{
|
||||
uuid:6402,name:"单体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],info:"随机1个友方+20最大生命值",
|
||||
},
|
||||
6403:{
|
||||
uuid:6403,name:"单体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],info:"随机1个友方+2攻击,+10最大生命值",
|
||||
},
|
||||
6404:{
|
||||
uuid:6404,name:"群体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"ap_up",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],info:"随机3个友方+2攻击",
|
||||
},
|
||||
6405:{
|
||||
uuid:6405,name:"群体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],info:"随机3个友方+10最大生命值",
|
||||
},
|
||||
6406:{
|
||||
uuid:6406,name:"群体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"ap_up",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.1,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"随机3个友方+2攻击,+10最大生命值",
|
||||
},
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { _decorator, Label, Node, UITransform } from "cc";
|
||||
import { _decorator, Label, Node, NodeEventType, UITransform } 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 { HeroInfo } from "../common/config/heroSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('IBoxComp')
|
||||
@@ -29,6 +30,14 @@ export class IBoxComp extends CCComp {
|
||||
this.renderHeroInfo(args);
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
this.node.on(NodeEventType.TOUCH_END, this.onTapClose, this);
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
this.node.off(NodeEventType.TOUCH_END, this.onTapClose, this);
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
@@ -42,9 +51,11 @@ export class IBoxComp extends CCComp {
|
||||
const heroLv = Math.max(1, Math.floor(args?.heroLv ?? 1));
|
||||
const hero = HeroInfo[heroUuid];
|
||||
if (!hero) {
|
||||
this.setHeroName("");
|
||||
this.applyLineTexts(["暂无技能信息"]);
|
||||
return;
|
||||
}
|
||||
this.setHeroName(hero.name);
|
||||
const runtimeSkills = args?.skills ? Object.values(args.skills) : [];
|
||||
const sourceSkills = runtimeSkills.length > 0 ? runtimeSkills : Object.values(hero.skills ?? {});
|
||||
const skillTexts = sourceSkills.map(skill => {
|
||||
@@ -78,14 +89,24 @@ export class IBoxComp extends CCComp {
|
||||
}
|
||||
|
||||
private updateIBoxHeight(height: number) {
|
||||
const rootTransform = this.node.getComponent(UITransform);
|
||||
if (rootTransform) {
|
||||
rootTransform.setContentSize(rootTransform.contentSize.width, height);
|
||||
}
|
||||
const bgNode = this.node.getChildByName("Bg");
|
||||
const bgTransform = bgNode?.getComponent(UITransform);
|
||||
if (bgTransform) {
|
||||
bgTransform.setContentSize(bgTransform.contentSize.width, height);
|
||||
}
|
||||
}
|
||||
|
||||
private setHeroName(name: string) {
|
||||
const bgNode = this.node.getChildByName("Bg");
|
||||
const nameNode = bgNode?.getChildByName("name");
|
||||
const valNode = nameNode?.getChildByName("val");
|
||||
const label = valNode?.getComponent(Label) || valNode?.getComponentInChildren(Label);
|
||||
if (label) {
|
||||
label.string = name;
|
||||
}
|
||||
}
|
||||
|
||||
private onTapClose() {
|
||||
oops.gui.removeByNode(this.node);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user