Exemplo n.º 1
0
            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());
                }
            }
Exemplo n.º 2
0
            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);
                }
            }
Exemplo n.º 3
0
 public abstract float GetTime(OrdinaryEnemyChase fsm);
Exemplo n.º 4
0
 public abstract float GetSpeed(OrdinaryEnemyChase fsm);
Exemplo n.º 5
0
 public override void OnEnterWithEvent(OrdinaryEnemyChase fsm)
 {
     chasePoint = fsm.chaseState.chaseTarget.transform.position;
     timer      = Timer.CreateATimer(GetTime(fsm), () => {
     }, fsm.top);
 }
Exemplo n.º 6
0
 public override void OnEnterWithEvent(OrdinaryEnemyChase fsm)
 {
     SoundManager.PlaySound(fsm.top.sound, "OrdinaryEnemy2");
     timer = Timer.CreateATimer(fsm.top.slowTime, null, fsm.top);
 }
Exemplo n.º 7
0
 public override float GetTime(OrdinaryEnemyChase fsm)
 {
     return(fsm.top.fastTime);
 }
Exemplo n.º 8
0
 public override float GetSpeed(OrdinaryEnemyChase fsm)
 {
     return(fsm.top.fastSpeed);
 }
Exemplo n.º 9
0
 public override void OnEnterWithEvent(OrdinaryEnemyChase fsm)
 {
     base.OnEnterWithEvent(fsm);
     SoundManager.PlaySound(fsm.top.sound, "OrdinaryEnemy");
 }