Exemple #1
0
    //public void loseLife()
    //{
    //    sound.GetComponent<AudioSource>().PlayOneShot(loseSound, 0.85f);

    //    if (lives >= 0)
    //    {
    //        hearts.transform.GetChild(lives).gameObject.SetActive(false);
    //        heartsBroken.transform.GetChild(lives).transform.position = hearts.transform.GetChild(lives).transform.position;
    //        heartsBroken.transform.GetChild(lives).gameObject.SetActive(true);
    //        lives--;
    //        if (lives < 0)
    //        {
    //            gameOver = true;
    //            gameOverScore.GetComponent<Text>().text = "SCORE : " + sScript.score;
    //            gameOverScore.transform.GetChild(0).GetComponent<Text>().text = "SCORE : " + sScript.score;

    //            destroyObjs();

    //            gameOvrImg.SetActive(true);
    //            gameOverCan.SetActive(true);

    //            StartCoroutine(loseLifeWait());
    //        }
    //    }
    //}

    IEnumerator loseLifeWait()
    {
        checkRank();
        yield return(new WaitForSeconds(0.4f));

        scrolSc.nextText(sScript.rankIndex);
        yield return(new WaitForSeconds(1f));

        if (SceneManager.GetActiveScene().name != "S 4 lvl 4")
        {
            replayBut.SetActive(true);
        }
        quitBut.SetActive(true);
    }