feat(gui): 新增英雄技能组件和按钮预制体
- 添加 HSkillComp 组件用于管理英雄技能界面 - 新增 Btn.prefab 按钮预制体资源 - 在 role_controller.prefab 中添加 heros 节点用于显示英雄界面
This commit is contained in:
58
assets/script/game/map/HSkillComp.ts
Normal file
58
assets/script/game/map/HSkillComp.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
1
assets/script/game/map/HSkillComp.ts.meta
Normal file
1
assets/script/game/map/HSkillComp.ts.meta
Normal file
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"34b93128-7505-4579-91c9-a93e9f1040ad","files":[],"subMetas":{},"userData":{}}
|
||||
Reference in New Issue
Block a user