18 lines
593 B
TypeScript
18 lines
593 B
TypeScript
import { _decorator } from 'cc'
|
|
import { EntityManager } from '../../Base/EntityManager'
|
|
import { EntityTypeEnum, EntityStateEnum } from '../../Enum'
|
|
import { 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
|
|
}
|
|
}
|