技能基本搞定

This commit is contained in:
2025-01-04 00:09:14 +08:00
parent 0524eee5e0
commit 66f4a0de82
59 changed files with 1033 additions and 4158 deletions

View File

@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { BoxSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { HeroViewComp } from "../hero/HeroViewComp";
const { ccclass, property } = _decorator;
@@ -26,6 +27,7 @@ export class SkillCom extends CCComp {
box_tag:number=0;
type:number = 1;
in_time:number = 0.3; // 不动技能持续时间
enemys:any = [];
start() {
this.node.active=true
let collider = this.getComponent(Collider2D);
@@ -42,6 +44,19 @@ export class SkillCom extends CCComp {
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(otherCollider.group != selfCollider.group&&otherCollider.tag ==0){
this.atk_count+=1
// console.log("skill onBeginContact",otherCollider.node.getComponent(HeroViewComp).uuid)
// let uid=otherCollider.node.getComponent(HeroViewComp).uuid
// const count = this.enemys.filter(enemy => enemy.uid === uid).length;
// if(count==0){
// // otherCollider.node.getComponent(HeroViewComp).check_uatk(this)
// console.log("count==0",otherCollider.node.getComponent(HeroViewComp).uuid)
// this.enemys.push(uid)
// }
// if(this.type==1 ){
// this.is_destroy=true
// }
// console.log("skill onBeginContact",selfCollider.group,otherCollider.group)
// if(this.type==1 ){
// this.is_destroy=true