技能ui完成, todo 技能执行
This commit is contained in:
@@ -9,20 +9,12 @@ import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,Sp
|
||||
/** Skill 模块 */
|
||||
@ecs.register(`Skill`)
|
||||
export class Skill extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// SkillModel!: SkillModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// SkillBll!: SkillBllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
SkillView!: SkillCom;
|
||||
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
@@ -32,7 +24,7 @@ export class Skill extends ecs.Entity {
|
||||
load(pos: Vec3 = Vec3.ZERO,group:number,parent:Node,uuid:number=1001,
|
||||
ap:number =10,t_pos:Vec3 = null,is_crit:boolean=false,crit_add:number=0)
|
||||
{
|
||||
var path = "game/skills/"+smc.skills[uuid].sp_name;
|
||||
var path = "game/skills/"+SkillSet[uuid].sp_name;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
// console.log("load skill :",path,prefab)
|
||||
var node = instantiate(prefab);
|
||||
@@ -42,29 +34,29 @@ export class Skill extends ecs.Entity {
|
||||
node.setPosition(pos)
|
||||
var sv = node.getComponent(SkillCom)!;
|
||||
let angle=0
|
||||
if(smc.skills[uuid].angle){
|
||||
if(SkillSet[uuid].angle){
|
||||
angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
|
||||
|
||||
}
|
||||
sv.angle = angle;
|
||||
// console.log(smc.skills[uuid].name+"angle:"+angle)
|
||||
// console.log(SkillSet[uuid].name+"angle:"+angle)
|
||||
sv.s_uuid = uuid;
|
||||
sv.ap = ap;
|
||||
sv.is_crit=is_crit
|
||||
sv.crit_add=crit_add
|
||||
// node.setScale(v3(node.scale.x*scale,node.scale.y))
|
||||
|
||||
sv.speed=smc.skills[uuid].speed;
|
||||
sv.dis=smc.skills[uuid].dis;
|
||||
sv.run_type=smc.skills[uuid].run;
|
||||
sv.speed=SkillSet[uuid].speed;
|
||||
sv.dis=SkillSet[uuid].dis;
|
||||
sv.run_type=SkillSet[uuid].run;
|
||||
if(sv.dis == 0){
|
||||
sv.run_type=2
|
||||
}
|
||||
|
||||
sv.in_time=smc.skills[uuid].in;
|
||||
sv.in_time=SkillSet[uuid].in;
|
||||
|
||||
sv.t_pos = t_pos; // 目标增量
|
||||
sv.type = smc.skills[uuid].type;
|
||||
sv.type = SkillSet[uuid].type;
|
||||
sv.box_tag= BoxSet.SKILL_TAG;
|
||||
sv.box_group=group
|
||||
// console.log("load skill :",sv)
|
||||
|
||||
@@ -51,7 +51,7 @@ export class TooltipCom extends CCComp {
|
||||
).start()
|
||||
break
|
||||
case 3:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+smc.skills[this.s_uuid].name+">";
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+SkillSet[this.s_uuid].name+">";
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
|
||||
Reference in New Issue
Block a user