void Awake() { FSM = new FiniteStateMachine <EnemyController>(); stateAttack = new EnemyStateAttack(); stateDie = new EnemyStateDie(); stateMove = new EnemyStateMove(); enemyAnimation = this.GetComponentInChildren <EnemyAnimation>(); enemyAttack = this.GetComponentInChildren <EnemyAttack>(); StateAction = EEnemyStateAction.MOVE; StateDirection = EDirection.NONE; }
public EnemyStateBase Create(EnemyAI.STATE state) { EnemyStateBase ret = null; switch (state) { case EnemyAI.STATE.ATTACK: ret = new EnemyStateAttack(this.obj, this.finder, this.dashSpeed, dashRotSpeed); break; case EnemyAI.STATE.BREAKTIME: ret = new EnemyStateBreaktime(this.obj, this.finder, this.breakInterval); break; case EnemyAI.STATE.SEARCH: ret = new EnemyStateSearch(this.obj, this.finder, this.actionNum); break; } return(ret); }