Пример #1
0
 public void UpdateState()
 {
     if (Time.time - time >= statePatternEnemy.delayTime && timeSet)
     {
         statePatternEnemy.ChangeState(new RedManChaseState(statePatternEnemy));
         //GlitchFx.instance.Reset();
     }
 }
Пример #2
0
 public override void StartEvent()
 {
     Ambient.instance.StopAllCoroutines();
     this.GetComponent <AudioSource>().Play();
     Controls.GetInstance().active = false;
     ScreenShake.instance.shake(0.5f);
     GlitchFx.instance.SetTemp(5, .8f);
     statePatternEnemy.ChangeState(new MirrorImageState(statePatternEnemy));
 }
Пример #3
0
    public void UpdateState()
    {
        if (statePatternEnemy.ReadyToMirror())
        {
            statePatternEnemy.ChangeState(new MirrorImageState(statePatternEnemy));
        }
        Movement player = statePatternEnemy.GetPlayer();

        if (player != null)
        {
            statePatternEnemy.movement.MoveTowardsObject(player);
            if (Vector2.Distance(statePatternEnemy.transform.position, statePatternEnemy.player.transform.position) < statePatternEnemy.maxAttackDistance && statePatternEnemy.CanSeePlayer() && (Time.time - statePatternEnemy.lastAttackTime > statePatternEnemy.timeBetweenAttacks))
            {
                statePatternEnemy.ChangeState(new RedManAttackState(statePatternEnemy));
            }
            else if ((Time.time - statePatternEnemy.lastAttackTime > 2 * statePatternEnemy.timeBetweenAttacks))
            {
                statePatternEnemy.ChangeState(new RedManAttackState(statePatternEnemy));
            }
        }
    }