Exemplo n.º 1
0
    void Update()
    {
        playerDetector.MyUpdate();

        if (IHaveSight)
        {
            sight.MyUpdate();
        }

        execution.MyUpdate();

        ImDetectingPlayer();

        CountAlertTime();

        switch (states)
        {
        case State.Sound:
            SoundUpdate();
            break;

        case State.Look:
            LookUpdate();
            break;

        case State.Patrol:
            PatrolUpdate();
            break;

        case State.Stationary:
            StationaryUpdate();
            break;

        case State.detect:
            DetectUpdate();
            break;

        case State.Chase:
            ChaseUpdate();
            break;

        case State.Attack:
            AttackUpdate();
            break;

        case State.Stunned:
            StunnedUpdate();
            break;

        case State.die:
            DieUpdate();
            break;

        default:
            break;
        }

        anim.MyUpdate();
    }