public override void OnExcuteWithEvent(OrdinaryEnemyChase fsm) { var dir = chasePoint - fsm.top.mov.Position; fsm.velocity = dir.normalized * GetSpeed(fsm); if (dir.magnitude < 0.1f || timer.Value == 1) { fsm.ChangeState(GetNextState()); } }
public override void OnExcuteWithEvent(OrdinaryEnemyChase fsm) { Vector2 chasePoint = fsm.chaseState.chaseTarget.transform.position; var dir = chasePoint - fsm.top.mov.Position; fsm.velocity = dir.normalized * fsm.top.slowSpeed; if (timer.Value == 1) { fsm.ChangeState <FastState>(null); } }
public abstract float GetTime(OrdinaryEnemyChase fsm);
public abstract float GetSpeed(OrdinaryEnemyChase fsm);
public override void OnEnterWithEvent(OrdinaryEnemyChase fsm) { chasePoint = fsm.chaseState.chaseTarget.transform.position; timer = Timer.CreateATimer(GetTime(fsm), () => { }, fsm.top); }
public override void OnEnterWithEvent(OrdinaryEnemyChase fsm) { SoundManager.PlaySound(fsm.top.sound, "OrdinaryEnemy2"); timer = Timer.CreateATimer(fsm.top.slowTime, null, fsm.top); }
public override float GetTime(OrdinaryEnemyChase fsm) { return(fsm.top.fastTime); }
public override float GetSpeed(OrdinaryEnemyChase fsm) { return(fsm.top.fastSpeed); }
public override void OnEnterWithEvent(OrdinaryEnemyChase fsm) { base.OnEnterWithEvent(fsm); SoundManager.PlaySound(fsm.top.sound, "OrdinaryEnemy"); }