Exemplo n.º 1
0
    void Awake()
    {
        audios             = GetComponents <AudioSource>();
        mainAudioSource    = audios[1];
        effectsAudioSource = audios[0];
        clipDead           = Resources.Load <AudioClip>("Sounds/smb_mariodie");
        winGame            = Resources.Load <AudioClip>("Sounds/smb_stage_clear");

        Score.text = CounterManager.getScore().ToString(StringFormat);
        Coins.text = CounterManager.getCoins().ToString();
        Timer.text = InitialTime.ToString(StringFormat);

        marioController.OnKilled += RestartLevel;
    }
Exemplo n.º 2
0
    private void Update()
    {
        if (gameEnabled)
        {
            timer += Time.deltaTime;
            var seconds = (int)(timer % 60);
            var time    = timeLeft(seconds);

            if (isRunOutTime(time))
            {
                RestartLevel();
            }
            else
            {
                Timer.text = time.ToString(StringFormat);
                Score.text = CounterManager.getScore().ToString(StringFormat);
                Coins.text = CounterManager.getCoins().ToString();
            }
        }
    }