Exemple #1
0
    public void NextArea()
    {
        score += (int)timer.RemainingTime;
        if (currentTarget)
        {
            currentTarget.AppendText($"+{(int)timer.RemainingTime}");
        }
        scoreText.text = $"{score.ToString()} Pts.";

        List <Area> availableAreas = areas.Where(x => !x.HitCollider.enabled).ToList();

        if (availableAreas.Count > 0)
        {
            timer.SetTime(15);
            timer.StartTimer();

            Area area = availableAreas[Random.Range(0, availableAreas.Count - 1)];
            area.Activate();
            currentTarget = area;
        }
        else
        {
            timer.PauseTimer(true);
            DoneEvent.Invoke();
            int y = SceneManager.GetActiveScene().buildIndex;
            Debug.Log(y);
            ScoreScreenController.MoveToScores(new List <int> {
                score
            }, y);
        }
    }