Files
pixelheros/assets/script/game/map/HSkillComp.ts
walkpan 45ba5b72f5 feat(gui): 新增英雄技能组件和按钮预制体
- 添加 HSkillComp 组件用于管理英雄技能界面
- 新增 Btn.prefab 按钮预制体资源
- 在 role_controller.prefab 中添加 heros 节点用于显示英雄界面
2026-03-13 18:32:18 +08:00

58 lines
1.6 KiB
TypeScript

import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3, ProgressBar, SpriteAtlas } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { getHeroList, getPreAttr, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
import { smc } from '../common/SingletonModuleComp';
import { GameEvent } from '../common/config/GameEvent';
import { CCComp } from 'db://oops-framework/module/common/CCComp';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { SkillSet } from '../common/config/SkillSet';
import { mLogger } from '../common/Logger';
const { ccclass, property } = _decorator;
@ccclass('HSkillComp')
@ecs.register('HSkillComp', false)
export class HSkillComp extends CCComp {
debugMode: boolean = false;
h_uuid:number=0
private uiconsAtlas: SpriteAtlas | null = null;
protected onLoad(): void {
}
start() {
}
start_test(){
this.node.active=true
this.node.parent.getChildByName("mission_home").active=false
}
end_test(){
this.node.parent.getChildByName("mission_home").active=true
this.node.active=false
}
update(deltaTime: number) {
}
update_data(uuid:number){
}
load_hui(uuid:number){
var path = "game/gui/hui";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
// 将节点添加到父节点下
this.node.addChild(node);
// 设置节点位置
}
reset() {
this.node.destroy()
}
}