2022-11-27 23:23:47 +08:00

18 lines
678 B
TypeScript

import { _decorator, Animation, AnimationClip, Node, Sprite, Vec3, Vec2, RigidBody2D } from 'cc'
import { EntityManager } from '../../Base/EntityManager'
import { EntityTypeEnum, EntityStateEnum, EventEnum } from '../../Enum'
import { IBullet, IVec2 } from '../../Global/DataManager'
import { ExplosionStateMachine } from './ExplosionStateMachine'
const { ccclass, property } = _decorator
@ccclass('ExplosionManager')
export class ExplosionManager extends EntityManager {
init(type: EntityTypeEnum, { x, y }: IVec2) {
this.node.setPosition(x, y)
this.fsm = this.addComponent(ExplosionStateMachine)
this.fsm.init(type)
this.state = EntityStateEnum.Idle
}
}