This commit is contained in:
2024-08-08 10:44:58 +08:00
parent d06189486d
commit 3eca33a33f
11 changed files with 677 additions and 453 deletions

View File

@@ -51,7 +51,7 @@ export class SingletonModuleComp extends ecs.Comp {
},
shuaxin: {
min: 0,
max: 20,
max: 2,
speed:1,
},
gold_add: {

View File

@@ -72,7 +72,7 @@ export class Monster extends ecs.Entity {
oops.message.dispatchEvent("monster_load",this)
}
console.log(smc.heros_in,smc.monsters_in)
}
/** 移动ECS System处理逻辑分享功能独立的业务代码 */

View File

@@ -5,11 +5,12 @@
* @LastEditTime: 2022-08-17 12:36:18
*/
import { Vec3, _decorator ,tween, v3,Collider2D,Contact2DType,PhysicsSystem2D,IPhysics2DContact,EPhysics2DDrawFlags,Label,Node} from "cc";
import { Vec3, _decorator , v3,Collider2D,Contact2DType,PhysicsSystem2D,IPhysics2DContact,EPhysics2DDrawFlags,Label,Node} 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 { MonsterSpine } from "./MonsterSpine";
import { Monster } from "./Monster";
import { Hero } from "./Hero";
import { MonsterModelComp } from "./MonsterModelComp";
import { BoxSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp";
@@ -50,6 +51,9 @@ export class MonsterViewComp extends CCComp {
// collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this);
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
}
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
switch (selfCollider.group) {
@@ -57,7 +61,7 @@ export class MonsterViewComp extends CCComp {
switch (otherCollider.group){
case BoxSet.HERO:
this.state = 2;
console.log('onBeginContact',selfCollider,otherCollider);
// console.log('onBeginContact',selfCollider,otherCollider);
// this.speed = 0;
// this.timer = 1;
// console.log("speed:"+this.speed+" | timer:"+this.timer);
@@ -135,7 +139,7 @@ export class MonsterViewComp extends CCComp {
}
this.move(dt);
this.update_pos();
// this.update_pos();
}