public override void process(BossSM fsm) { if (fsm.unit.HorizonSpeed == 0) { fsm.anim.SetSpeed(1); fsm.anim.ChangeAnim(BossAnim.Idle); } else { fsm.anim.SetSpeed(fsm.unit.HorizonSpeed / fsm.unit.stat.moveSpeed); fsm.anim.ChangeAnim(BossAnim.Walk); } if (fsm.CheckAttackable()) { fsm.ChangeState(_attackList[fsm.CurPhase][_curAttackOrder]); _curAttackOrder++; return; } fsm.SetDirection(fsm.unit.Target.transform.position.x > fsm.unit.transform.position.x); if (fsm.doesLookRight()) { fsm.unit.Move(1); } else { fsm.unit.Move(-1); } }
public override void process(BossSM fsm) { if (fsm.IsAttacked) { float deltaX; Vector3 pos = fsm.unit.transform.position; if (fsm.doesLookRight()) { deltaX = 0.5f; } else { deltaX = -0.5f; } fsm.unit.transform.position = new Vector3(pos.x + deltaX, pos.y, pos.z); fsm.unit.Attack(); } if (fsm.IsAttackEnd) { switch (fsm.CurPhase) { case 0: fsm.ChangeState(fsm.chaseState); break; case 1: break; case 2: break; } } }
public override void process(BossSM fsm) { // about transition if (fsm.CheckView()) { fsm.ChangeState(fsm.chaseState); } }
public override void enter(BossSM fsm) { if (!_isInit) { Init(); } if (_lastPhase != fsm.CurPhase) { _lastPhase = fsm.CurPhase; _curAttackOrder = 0; } _curAttackOrder = _curAttackOrder % _attackList[fsm.CurPhase].Count; }
private void Awake() { _bossSM = GetComponentInParent <BossSM>(); }
public override void exit(BossSM fsm) { }
public override void process(BossSM fsm) { }
public override void enter(BossSM fsm) { fsm.anim.ChangeAnim(BossAnim.Die); fsm.unit.Idle(); }
public override void enter(BossSM fsm) { fsm.anim.ChangeAnim(BossAnim.DownPunch); fsm.unit.Idle(); fsm.unit.SetAttackBox(4); }
public override void enter(BossSM fsm) { fsm.anim.ChangeAnim(BossAnim.Tornado); fsm.unit.Idle(); fsm.unit.SetAttackBox(3); }
public override void enter(BossSM fsm) { fsm.anim.ChangeAnim(BossAnim.Uppercut); fsm.unit.Idle(); fsm.unit.SetAttackBox(2); }
public override void exit(BossSM fsm) { fsm.unit.Idle(); fsm.anim.SetSpeed(1); fsm.anim.ChangeAnim(BossAnim.Idle); }
public abstract void exit(BossSM fsm);
public abstract void process(BossSM fsm);
public abstract void enter(BossSM fsm);