Beispiel #1
0
 private void Start()
 {
     thought    = thoughtPanel.GetComponent <ThoughtKitchen>();
     addinstuff = StuffPanel.GetComponent <AddInStuffKitchen>();
     thought.ShowThought(0);
     smicrowave = microwave.GetComponent <microwave>();
 }
Beispiel #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     collision.gameObject.transform.rotation = new Quaternion(0, 0, 0, 0);
     if (collision.gameObject.GetComponent <SpriteRenderer>().sprite.name == "dripping_pan" || collision.gameObject.GetComponent <SpriteRenderer>().sprite.name == "pan")
     {
         thought.ShowThought(7);
     }
     else if (gameObject.GetComponent <SpriteRenderer>().sprite.name == "microwave_closed")
     {
         thought.ShowThought(4);
     }
     else if (collision.gameObject.GetComponent <SpriteRenderer>().sprite.name == "plate_4")
     {
         usingMicrowaveEmpty = true;
         gameObject.GetComponent <SpriteRenderer>().sprite = useMicrowaveImg[2];
         collision.gameObject.SetActive(false);
     }
     else if (collision.gameObject.GetComponent <SpriteRenderer>().sprite.name == "plate_4_full")
     {
         usingMicrowaveFull = true;
         gameObject.GetComponent <SpriteRenderer>().sprite = useMicrowaveImg[6];
         collision.gameObject.SetActive(false);
     }
 }
Beispiel #3
0
    public void button1_click()
    {
        bool plate      = false;
        int  countStuff = 0;

        foreach (GameObject g in stuffVisible)
        {
            if (g.activeSelf == true)
            {
                countStuff++;
            }
            else if (g.name == "stuff_plate_full")
            {
                plate = true;
            }
        }
        if (countStuff == 5)
        {
            if (fridge.GetComponent <SpriteRenderer>().sprite.name == "fridge_closed")
            {
                SceneManager.LoadScene(4);
            }
            else
            {
                thought.ShowThought(8);
            }
        }
        else if (plate)
        {
            thought.ShowThought(2);
        }
        else
        {
            thought.ShowThought(1);
        }
    }