refactor(技能系统): 重构技能系统以使用s_uuid作为主键并优化技能施放逻辑
- 将HeroSkillsComp中的技能数组改为以s_uuid为键的对象存储 - 修改CSRequestComp使用s_uuid替代skillIndex - 优化SkillCastSystem和SACastSystem的施放逻辑 - 为SMoveDataComp添加rePos方法处理技能位置计算 - 移除未使用的SDataComSystem代码
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, Animation, Collider2D, Contact2DType, Vec3 } from "cc";
|
||||
import { _decorator, Animation, CCInteger, Collider2D, Contact2DType, v3, Vec3 } 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 { HeroViewComp } from "../hero/HeroViewComp";
|
||||
@@ -15,6 +15,11 @@ const { ccclass, property } = _decorator;
|
||||
@ecs.register('SkillView', false)
|
||||
export class SkillView extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
@property({ type: CCInteger })
|
||||
atk_x: number = 0
|
||||
@property({ type: CCInteger })
|
||||
|
||||
atk_y: number = 0
|
||||
anim:Animation=null;
|
||||
group:number=0;
|
||||
SConf:any=null;
|
||||
@@ -29,6 +34,9 @@ export class SkillView extends CCComp {
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
}
|
||||
const SMove=this.ent.get(SMoveDataComp)
|
||||
// 计算延长后的目标点坐标
|
||||
SMove.rePos(v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y))
|
||||
|
||||
switch(this.SConf.RType){
|
||||
case RType.linear:
|
||||
this.do_linear(SMove.startPos,SMove.targetPos)
|
||||
@@ -54,6 +62,7 @@ export class SkillView extends CCComp {
|
||||
if (!this.SConf) return;
|
||||
}
|
||||
}
|
||||
|
||||
do_bezier(startPos:Vec3,targetPos:Vec3){
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
this.node.angle +=10
|
||||
|
||||
Reference in New Issue
Block a user