Ejemplo n.º 1
0
    void Start()
    {
        goToIntroButton.onClick.AddListener(delegate { ButtonPressed(); });

        scores = FindObjectOfType <PersistingScore>();
        string formattedScore = scores.getScores();

        TextScores.text = formattedScore;
    }
Ejemplo n.º 2
0
    void Update()
    {
        update    += Time.deltaTime;
        timer.text = update.ToString("F3");
        if (activeBlocks == 0 && update > 1f)
        {
            if (once == false)
            {
                once = true;
                AudioSource.PlayClipAtPoint(victoryClip[Random.Range(0, victoryClip.Length)], Camera.main.transform.position);

                PersistingScore actualScore = FindObjectOfType <PersistingScore>();
                if (actualScore != null)
                {
                    actualScore.AddScore(update.ToString("F3"));
                }
            }
            Time.timeScale = 0f;
            if (sceneName != "")
            {
                activeWinFields(true);
            }
        }
    }