public PlayerState(GameObject gameObject) { this.gameObject = gameObject; moveState = new MoveState(); attackState = new AttackState(); dieState = new DieState(); injuredState = new InjuredState(); autoMove = new AutoMoveState(); SetState(States.move); curState = moveState; }
public EnemyState(GameObject gameObject) { this.gameObject = gameObject; moveState = new MoveState(); attackState = new AttackState(); dieState = new DieState(); injuredState = new InjuredState(); autoMove = new AutoMoveState(); SetState(States.move); curState = moveState; ani = gameObject.GetComponent <Animator>(); }
protected override void InitAllState() { IdleState = new IdleState(this); RunState = new RunState(this); unarmedAttack_0State = new UnarmedAttack_0State(this); unarmedAttack_1State = new UnarmedAttack_1State(this); unarmedAttack_2State = new UnarmedAttack_2State(this); unarmedAttack_3State = new UnarmedAttack_3State(this); unarmedRollState = new RollState(this); unarmedInjuredState = new InjuredState(this); axeAttack_0State = new AxeAttack_0State(this); axeAttack_1State = new AxeAttack_1State(this); axeAttack_2State = new AxeAttack_2State(this); switchState = new SwitchState(this); CurrentState = IdleState; }