Ejemplo n.º 1
0
    IEnumerator LampDies()
    {
        yield return(new WaitForSeconds(.2f));

        try{
            lampanime.SetBool("dead", true);
        }

        catch (System.NullReferenceException ne) {
            Debug.Log(ne);
        }
        boxArray = GameObject.FindGameObjectsWithTag("boxes");
        for (int i = 0; i < boxArray.Length; i++)
        {
            GeneralControls.DestroyBox(boxArray[i]);
        }


        if (PlayerPrefs.GetInt("level10complete") != 1)
        {
            PlayerPrefs.SetInt("level10complete", 1);
        }

        StartCoroutine("DestroyLamp");
    }
Ejemplo n.º 2
0
    IEnumerator DestroyLamp()
    {
        yield return(new WaitForSeconds(1));

        GeneralControls.DestroyBox(lamp_color);
        victory.SetActive(true);
        Sound.instance.victorious();
        trying.SetActive(false);
        defeated1.SetActive(false);
        zerodefeated.SetActive(false);
    }
Ejemplo n.º 3
0
    IEnumerator resetbox1()
    {
        yield return(new WaitForSeconds(1));

        if (temp1 != null)
        {
            GeneralControls.DestroyBox(temp1);
        }

        temp1 = null;
    }
Ejemplo n.º 4
0
    IEnumerator resetbox2()
    {
        yield return(new WaitForSeconds(1));

        if ((temp1 != null) && (temp2 != null))
        {
            GeneralControls.DestroyBox(temp1);
            GeneralControls.DestroyBox(temp2);
        }

        temp1 = null;
        temp2 = null;
    }
Ejemplo n.º 5
0
    IEnumerator zeroremains()
    {
        yield return(new WaitForSeconds(0.2f));

        for (int i = 0; i < boxes.Length; i++)
        {
            if ((boxes[i] != null) &&
                (boxes[i] != temp1) &&
                (boxes[i] != temp2) &&
                (boxes[i] != temp3))
            {
                GeneralControls.DestroyBox(boxes[i]);
            }
        }
        zerodefeated.SetActive(true);
        trying.SetActive(false);
        Sound.instance.defeated();
        lamp_color.SetActive(false);
    }
Ejemplo n.º 6
0
    IEnumerator defeat()
    {
        yield return(new WaitForSeconds(0.5f));

        for (int i = 0; i < boxArray.Length; i++)
        {
            if ((boxArray[i] != null) &&
                (boxArray[i] != temp1) &&
                (boxArray[i] != temp2) &&
                (boxArray[i] != temp3))
            {
                GeneralControls.DestroyBox(boxArray[i]);
            }
        }


        defeated1.SetActive(true);
        Sound.instance.defeated();
    }