Exemplo n.º 1
0
    public IEnumerator ExecuteCombat()
    {
        defenseQueue.Clear();
        Animating = true;
        List <Animatable> deadOnes = new List <Animatable>();

        for (int i = 0; i < enemyLogics.Count; i++)
        {
            enemyLogics[i].EnterCombat();
        }
        while (animQueue.Length() > 0)
        {
            yield return(new WaitForSeconds(1));

            AnimationBean currentSet = animQueue.Next();
            if (currentSet.Win == WIN)
            {
                deadOnes.Add(currentSet.animatable);
            }
            else
            {
                deadOnes.Add(playerController);
            }
            RunAnimation(currentSet);
        }
        yield return(new WaitForSeconds(1.5f));

        AnimateDeaths(deadOnes);
        yield return(new WaitForSeconds(1));

        ExitCombat();
    }
Exemplo n.º 2
0
    void StartTime()
    {
        combatQueue.Clear();
        timer = false;
        playerController.StartTime();
        List <AttackMoves> toDie = new List <AttackMoves>();

        foreach (AttackMoves a in attackAnimators)
        {
            AttackMoves current = a.StartTime();
            if (current != null)
            {
                toDie.Add(current);
            }
        }

        foreach (AttackMoves a in toDie)
        {
            attackAnimators.Remove(a);
            Destroy(a.gameObject);
        }

        foreach (EnemyBehavior e in enemies)
        {
            e.looking = true;
        }
    }