This commit is contained in:
2024-08-12 17:16:39 +08:00
parent dedc020bbd
commit 825457fd0e
28 changed files with 766 additions and 383 deletions

View File

@@ -18,6 +18,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { baseCom } from "../skills/baseCom";
import { Skill } from "../skills/Skill";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { SkillCom } from "../skills/SkillCom";
const { ccclass, property } = _decorator;
/** 角色显示组件 */
@@ -27,6 +28,7 @@ export class MonsterViewComp extends CCComp {
/** 角色动画 */
as: MonsterSpine = null!;
hero_name : string = "hero";
level:number =1;
camp: number = 1; /** 角色阵营 1hero -1 :monster */
type: number = 1; /**角色类型 1前排 2 后排 */
state: number = 1; /** 状态 1move ,2: act 3: stop */
@@ -90,8 +92,10 @@ export class MonsterViewComp extends CCComp {
// }
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(otherCollider.group== BoxSet.HERO_SKILL || otherCollider.group== BoxSet.MONSTER_SKILL){
let skill = otherCollider.node.getComponent(SkillCom)!;
// console.log('onPostSolve',skill);
this.in_atked();
this.hp_change(10);
this.hp_change(skill.atk);
}
// switch (selfCollider.group) {
// case BoxSet.HERO: