24 lines
606 B
TypeScript
Raw Normal View History

2022-11-27 23:23:47 +08:00
import { _decorator, Component, Node, Layers, UITransform, Sprite, KeyCode, Vec2, RigidBody2D, BoxCollider2D, Size, ERigidBody2DType } from 'cc';
import { EntityEnum, EntityStateEnum } from '../Enum';
import StateMachine from './StateMachine';
const { ccclass, property } = _decorator;
@ccclass('EntityManager')
export abstract class EntityManager extends Component {
fsm: StateMachine
private _state: EntityStateEnum
get state() {
return this._state
}
set state(newState) {
this._state = newState
this.fsm.setParams(newState, true)
}
abstract init(...args: any[]): void
}