2022-12-08 21:14:02 +08:00
|
|
|
import { _decorator } from "cc";
|
|
|
|
import { EntityManager } from "../../Base/EntityManager";
|
|
|
|
import { EntityTypeEnum, IVec2 } from "../../Common";
|
|
|
|
import { EntityStateEnum } from "../../Enum";
|
|
|
|
import { ExplosionStateMachine } from "./ExplosionStateMachine";
|
|
|
|
const { ccclass, property } = _decorator;
|
2022-11-27 23:23:47 +08:00
|
|
|
|
2022-12-08 21:14:02 +08:00
|
|
|
@ccclass("ExplosionManager")
|
2022-11-27 23:23:47 +08:00
|
|
|
export class ExplosionManager extends EntityManager {
|
|
|
|
init(type: EntityTypeEnum, { x, y }: IVec2) {
|
2022-12-08 21:14:02 +08:00
|
|
|
this.node.setPosition(x, y);
|
|
|
|
this.fsm = this.addComponent(ExplosionStateMachine);
|
|
|
|
this.fsm.init(type);
|
|
|
|
this.state = EntityStateEnum.Idle;
|
2022-11-27 23:23:47 +08:00
|
|
|
}
|
|
|
|
}
|