角色动画 确定

This commit is contained in:
2024-08-26 07:33:26 +08:00
parent 68d7077e56
commit 4f96558d36
111 changed files with 54661 additions and 1391 deletions

View File

@@ -1,6 +1,7 @@
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { BoxSet } from "../common/config/BoxSet";
import { SkillSet } from "../common/config/SkillSet";
import { smc } from "../common/SingletonModuleComp";
import { SkillCom } from "./SkillCom";
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
@@ -28,8 +29,8 @@ export class Skill extends ecs.Entity {
this.remove(SkillCom);
super.destroy();
}
load(pos: Vec3 = Vec3.ZERO,speed:number = 100,dis:number = 50,scale:number = 1,parent:Node,sp_name:string = "base",atk:number =10,angle = 0,t_pos:Vec3 = null) {
var path = "game/skills/"+sp_name;
load(pos: Vec3 = Vec3.ZERO,speed:number = 100,dis:number = 50,scale:number = 1,parent:Node,uuid:number=1001,atk:number =10,angle = 0,t_pos:Vec3 = null) {
var path = "game/skills/"+SkillSet[uuid].sp_name;
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = parent;
@@ -43,6 +44,7 @@ export class Skill extends ecs.Entity {
sv.atk = atk;
sv.angle = angle;
sv.t_pos = t_pos;
sv.type = SkillSet[uuid].type;
sv.box_tag= BoxSet.SKILL_TAG;
if(scale == 1){
sv.box_group=BoxSet.HERO

View File

@@ -27,6 +27,7 @@ export class SkillCom extends CCComp {
is_destroy:boolean = false;
box_group:number = 0;
box_tag:number=0;
type:number = 1;
time:Timer = new Timer(0.01);
start() {
this.node.active=true
@@ -70,7 +71,9 @@ export class SkillCom extends CCComp {
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(otherCollider.group != selfCollider.group&&otherCollider.tag !=BoxSet.ATK_RANGE&&otherCollider.tag !=BoxSet.SKILL_TAG){
// console.log("skill onBeginContact",selfCollider.group,otherCollider.group)
this.is_destroy=true
if(this.type==1){
this.is_destroy=true
}
}
}
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {