Exemplo n.º 1
0
    public IEnumerator OneSecondTimer()
    {
        while (canCount && 1 == 1)
        {
            //TRIGGER FAILSTATE: NO ACTIVE BALLS ON SCREEN
            if (currentGameSessions > 0 && messages.messageFinished && ballCount <= 0)
            {
                if (currentGameActive == true)
                {
                    print("no balls");
                    AudioManager.instance.PlaySingle(SFX_FailState);
                    ResetGame();
                }
            }


            yield return(new WaitForSeconds(1.0f));

            milliCount = 0;
            secCount++;

            timeFactor = spawnLevel * .0015f;

            scoreFactor = .015f * (spawnLevel + totalScore);
            spawnLevel += (secCount * timeFactor) + scoreFactor;
            temp        = (int)spawnLevel;

            ObsSpwnr.ObjectGenerator();

            if (secCount == 60)
            {
                secCount = 0;
                minCount++;
            }

            if (secCount == lastSecCount + spawnTime)
            {
                lastSecCount = secCount;
                canSpawn     = true;
            }
        }
    }