Exemplo n.º 1
0
        IEnumerator CheckHealthStateOfTriggeredMobs(bool first)
        {
            yield return(new WaitForSeconds(2f));

            if (first)
            {
                ambientSound.CombatMusicStart();
            }
            else
            {
                ambientSound.SecondCombatStart();
            }

            bool keepChecking = true;

            while (keepChecking)
            {
                bool refresh = false;
                foreach (Npc npc in triggeredMobs)
                {
                    if (npc.CurrentHP > 0)
                    {
                        refresh = true;
                    }
                }
                keepChecking = refresh;
                yield return(new WaitForSeconds(0.5f));
            }
            triggeredMobs.Clear();
            if (first)
            {
                ambientSound.CombatEnd();
                currentStage = 2;
            }
            else
            {
                ambientSound.SecondCombatEnd();
                currentStage = 4;
            }
            StartCoroutine(SaveGameAfterDelay());
        }