Exemplo n.º 1
0
    void Update()
    {
        RoundScore.text = Score.ToString("D6");

        if (SimulationEnded)
        {
            TextStageName.text = MapName;

            if (!EndGameActivated && (Score < MinScore))
            {
                Debug.Log("You lost.");
                if (Score <= 0)
                {
                    Debug.Log("0 Stars");
                    animations.SetStarCount(0);
                }
                else if (Score <= MinScore / 2)
                {
                    Debug.Log("1 Stars");
                    animations.SetStarCount(1);
                }
                else
                {
                    Debug.Log("2 Stars");
                    animations.SetStarCount(2);
                }
            }
            else if (!EndGameActivated && Score >= MinScore)
            {
                Debug.Log("You won.");
                LM.MarkCurrentLevelComplete();
                PlayerCanProgress = true;
                animations.SetStarCount(3);
            }

            canPause = false;
            // + Added by Karsten.
            cameraScript.enabled = false;

            animations.ShiftOutElements();
            animations.ActivateEndGameAnimation();

            // + Zoom camera out
            if (timeElapsed < 1.0f)
            {
                Cam.orthographicSize += Time.deltaTime;
                timeElapsed          += Time.deltaTime;
            }

            EndRoundScore.text = Score.ToString();
            EndGameActivated   = true;

            sounds.StopOperationMusic();
        }
    }
Exemplo n.º 2
0
 public void ActivateEndGameAnimation()
 {
     levelAnimations.ActivateEndGameAnimation();
 }