Ejemplo n.º 1
0
    public int RetrieveAllPieces()  //Called when all collected pieces are retrieved/recycled
    {
        int temp = totalAmount;

        //totalAmount = 0;
        StaticProgressManager.UpdateCompletion((temp - retrieveAmount) / totalExisting);
        retrieveAmount = temp;
        return(temp);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("OH " + gameObject.name);
        int   garbageLevel = 3;
        float completion   = StaticProgressManager.GetCompletion();

        completion = Mathf.Floor(completion);

        if (completion >= 100)
        {
            garbageLevel = 0;
            NewSprite(2);
            text.SetText("Você reciclou " + completion + "% do lixo eletrônico espalhado.\nParabéns! O mundo agora está mais limpo!");
        }
        else if (completion >= 75)
        {
            garbageLevel = 1;
            NewSprite(1);
            text.SetText("Você reciclou " + completion + "% do lixo eletrônico espalhado.\nHuuum... Quase lá, mas ainda existe um pouco de lixo por aí.");
        }
        else if (completion >= 50)
        {
            garbageLevel = 2;
            NewSprite(0);
            text.SetText("Você reciclou " + completion + "% do lixo eletrônico espalhado.\nNossa. Poderia ter se esforçado um pouco mais!");
        }
        else
        {
            garbageLevel = 2;
            NewSprite(0);
            text.SetText("Você reciclou " + completion + "% do lixo eletrônico espalhado.\nNossa. Poderia ter se esforçado um pouco mais!");
            // That's impossible, since the player needs at least 50% to end the game
            Debug.LogError("Something's wrong! Check EndingStory script");
        }

        foreach (GameObject fundo in fundosLixo)
        {
            if (fundo.name != ("Lixo" + garbageLevel))
            {
                fundo.SetActive(false);
            }
            else
            {
                fundo.SetActive(true);
            }
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        //return;

        int   garbageLevel = 3;
        float completion   = StaticProgressManager.GetCompletion();

        //Debug.Log("aaaaaa" + completion);

        if (completion >= 100)
        {
            garbageLevel = 0;
        }
        else if (completion >= 75)
        {
            garbageLevel = 1;
        }
        else if (completion >= 50)
        {
            garbageLevel = 2;
        }
        else
        {
            garbageLevel = 2;
            // That's impossible, since the player needs at least 50% to end the game
            // Debug.LogError("Something's wrong! Check StartStory script");
        }

        foreach (GameObject fundo in fundosLixo)
        {
            if (fundo.name != ("Lixo" + garbageLevel))
            {
                fundo.SetActive(false);
            }
            else
            {
                fundo.SetActive(true);
            }
        }
    }
Ejemplo n.º 4
0
 public void OnClick()
 {
     levelChanger.FadeToScene(3);
     StaticProgressManager.SetCompletion(0);
 }