Пример #1
0
 public void gameOver()
 {
     playerStatus.stop();
     playerController.stop();
     enemyPattern.stop();
     cheaterStatusLeft.stop();
     cheaterStatusRight.stop();
     gameoverPanel.SetActive(true);
     finalScore.text = "" + playerStatus.getScore();
 }
Пример #2
0
    private void nextPattern()
    {
        playerScore = player.getScore();

        //generate list of level that fit requirement
        listRandomPatternIndex.Clear();
        foreach (var item in level)
        {
            if (item.maximum < 0)
            {
                if (playerScore >= item.minimum)
                {
                    foreach (var num in item.patternIndex)
                    {
                        listRandomPatternIndex.Add(num);
                    }
                }
            }
            else
            {
                if (playerScore >= item.minimum && playerScore <= item.maximum)
                {
                    foreach (var num in item.patternIndex)
                    {
                        listRandomPatternIndex.Add(num);
                    }
                }
            }
        }

        //pick pattern from list
        int rand = Random.Range(0, listRandomPatternIndex.Count);

        currentPattern         = pattern [listRandomPatternIndex [rand]];
        currentSessionMaxIndex = currentPattern.session.Length - 1;
        currentSessionIndex    = 0;
        currentSession         = currentPattern.session [currentSessionIndex];
        countdown    = currentSession.duration;
        isTransition = false;
        activeSession();
    }