18 lines
581 B
TypeScript
Raw Normal View History

2022-12-01 22:26:41 +08:00
import { _decorator } from 'cc'
2022-11-27 23:23:47 +08:00
import { EntityManager } from '../../Base/EntityManager'
2022-12-03 20:06:57 +08:00
import { EntityTypeEnum, IVec2 } from '../../Common'
import { EntityStateEnum } from '../../Enum'
2022-11-27 23:23:47 +08:00
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
}
}