public void button3_click() { if (microwave.GetComponent <SpriteRenderer>().sprite.name == "plate_full_in_microwave_open" || microwave.GetComponent <SpriteRenderer>().sprite.name == "plate_empty_in_microwave_open") { if (heatedFull) { thought.ShowThought(6); addinstuff.AddObject("plate", true); background.GetComponent <SpriteRenderer>().sprite = boyEat; smicrowave.ChangeImgAfterEating(); for (int i = 0; i < pan.Length; i++) { pan[i].SetActive(false); } GameObject.Find("Canvas").GetComponent <Help_Kitcnen>().eat = true; } else if (heatedEmpty) { thought.ShowThought(3); StartCoroutine(smicrowave.Repeat()); } } else { thought.ShowThought(5); } }
public void OnMouseDown() { clicked = !clicked; if (clicked) { { gameObject.GetComponent <SpriteRenderer>().sprite = status[1]; gameObject.transform.localScale = new Vector2(0.2f, 0.2f); Chandelier.GetComponent <SpriteRenderer>().sprite = ChandelierStatus[1]; } } else { gameObject.GetComponent <SpriteRenderer>().sprite = status[0]; gameObject.transform.localScale = new Vector2(0.2f, 0.2f); Chandelier.GetComponent <SpriteRenderer>().sprite = ChandelierStatus[0]; } addinstuff.AddObject(gameObject.name, clicked); }
public void OnMouseDown() { clicked = !clicked; if (clicked) { gameObject.GetComponent <SpriteRenderer>().sprite = status[2]; gameObject.transform.position = new Vector3(shiftX, shiftY, -3f); } else { gameObject.GetComponent <SpriteRenderer>().sprite = status[0]; gameObject.transform.position = new Vector3(startX, startY, -3f); } try { stuffPanelScript.AddObject(gameObject.name, clicked); } catch { } // addinstuff.AddObject(gameObject.name, clicked); }