Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (zombieHealt.GetHealth() <= 0 && !isDead)
        {
            WaveSpawner.EnemiesAlive--;
            SetState(ZombieState.Dead);
        }

        switch (zombieState)
        {
        case ZombieState.Dead:
            KillZombie();
            break;

        case ZombieState.Attack:
            Attack();
            break;

        case ZombieState.Run:
            SearchForTarget();
            break;

        case ZombieState.Idle:
            SearchForTarget();
            break;
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (zombieHealt.GetHealth() <= 0)
        {
            SetState(ZombieState.Dead);
        }
        switch (zombieState)
        {
        case ZombieState.Dead:
            KillZombie();
            break;

        case ZombieState.Attack:
            Attack();
            break;

        case ZombieState.Walk:
            SearchForTarget();
            break;

        case ZombieState.Idle:
            SearchForTarget();
            break;

        default:
            break;
        }
    }