void OnTriggerStay(Collider other) { if (noOfServingsAvailable > 0) { if (isSoupContainer) { if (other.name.Contains("soupBowl")) { otherObject = other.gameObject; ObjectMotion otherObjectMotion = otherObject.GetComponent <ObjectMotion>(); if (!otherObjectMotion.mySoup.activeInHierarchy) { LevelSoundManager._instance.bttn_click.Play(); reachedDestination = true; } } } else if (isPan) { if (!isBurnt) { if (other.name.Contains("plate")) { otherObject = other.gameObject; ObjectMotion otherObjectMotion = otherObject.GetComponent <ObjectMotion>(); if (!otherObjectMotion.myNoodles.activeInHierarchy) { LevelSoundManager._instance.bttn_click.Play(); reachedDestination = true; } } } } if (China_Manager.tutorialEnd) { if (other.name.Contains("dustbin")) { otherObject = other.gameObject; reachedDestination = true; } } } }
public void ClickedDestination() { if (otherObject.name.Contains("dustbin")) { if (isSoupContainer) { isBurnt = false; heatingTimer = 0; noOfServingsAvailable = 0; myAlpha.gameObject.SetActive(false); myFood.gameObject.SetActive(false); myReadyFood.GetComponent <SpriteRenderer>().sprite = China_Manager._instance.soupContainerVariations[0]; myImage.sprite = ladleVariations[0]; vegAdded = false; China_Manager._instance.clickedSoupContainer = false; UIManager._instance.totalCoins -= China_Manager._instance.soupPrice; UIManager._instance.coinsText.text = UIManager._instance.totalCoins.ToString(); } else if (isPan) { isBurnt = false; heatingTimer = 0; mySmoke.gameObject.SetActive(false); noOfServingsAvailable = 0; scaledImage.gameObject.SetActive(false); myFood.gameObject.SetActive(false); myReadyFood.gameObject.SetActive(false); myImage.sprite = ladleVariations[0]; noodlesAdded = false; vegAdded = false; China_Manager._instance.clickedPan = false; UIManager._instance.totalCoins -= China_Manager._instance.perfectNoodlesPrice; UIManager._instance.coinsText.text = UIManager._instance.totalCoins.ToString(); LevelSoundManager._instance.dustbin.Play(); if (UIManager._instance.totalCoins > 0) { UIManager._instance.dustbin_textparent.SetActive(true); UIManager._instance.dustbin_text.text = "-" + China_Manager._instance.perfectNoodlesPrice.ToString(); Invoke("Deactivedustbin", 1.0f); } if (UIManager._instance.totalCoins < 0) { UIManager._instance.totalCoins = 0; UIManager._instance.coinsText.text = "0"; } } iAmSelected = false; startAnimating = false; } else { if (isSoupContainer) { if (otherObject != null) { ObjectMotion otherObjectMotion = otherObject.GetComponent <ObjectMotion>(); if (!otherObjectMotion.mySoup.activeInHierarchy) { otherObjectMotion.mySoup.SetActive(true); otherObjectMotion.soupScale.ResetToBeginning(); otherObjectMotion.soupScale.PlayForward(); otherObjectMotion.myType = LevelManager.Orders.SOUP; noOfServingsAvailable--; if (noOfServingsAvailable <= 0) { isBurnt = false; heatingTimer = 0; myAlpha.gameObject.SetActive(false); myFood.gameObject.SetActive(false); myReadyFood.GetComponent <SpriteRenderer>().sprite = China_Manager._instance.soupContainerVariations[0]; myImage.sprite = ladleVariations[0]; vegAdded = false; } if (tutorialOn) { tutorialPick = false; // UIManager._instance.tutorialPanelBg.gameObject.SetActive (true); China_Manager._instance.firstSoupBowl.tutorialOn = true; UIManager._instance.tutorialPanelBg.OpenPopupChina("DRAG TO THE \n CUSTOMER.", false, false, 6); tutorialOn = false; } iAmSelected = false; startAnimating = false; China_Manager._instance.clickedSoupContainer = false; } } } else if (isPan) { if (otherObject != null) { ObjectMotion otherObjectMotion = otherObject.GetComponent <ObjectMotion>(); if (!otherObjectMotion.myNoodles.activeInHierarchy) { if (tutorialOn) { tutorialPick = false; // UIManager._instance.tutorialPanelBg.gameObject.SetActive (true); China_Manager._instance.firstCustomer.tutorialOn = true; China_Manager._instance.noodlesPlatesMotion[0].tutorialOn = true; UIManager._instance.tutorialPanelBg.OpenPopupChina("DRAG TO THE \n CUSTOMER.", false, false, 6); tutorialOn = false; } otherObjectMotion.myNoodles.SetActive(true); otherObjectMotion.myType = LevelManager.Orders.NOODLES; if (heatingTimer >= perfectTimer && !isBurnt) { otherObjectMotion.perfect = true; otherObjectMotion.myNoodles.GetComponent <SpriteRenderer>().sprite = China_Manager._instance.noodlesInPlateVariations[1]; } else if (!isBurnt) { otherObjectMotion.myNoodles.GetComponent <SpriteRenderer>().sprite = China_Manager._instance.noodlesInPlateVariations[0]; } noOfServingsAvailable--; if (noOfServingsAvailable <= 0) { mySmoke.gameObject.SetActive(false); isBurnt = false; scaledImage.gameObject.SetActive(false); heatingTimer = 0; myFood.gameObject.SetActive(false); myReadyFood.gameObject.SetActive(false); myImage.sprite = ladleVariations[0]; noodlesAdded = false; vegAdded = false; } China_Manager._instance.clickedPan = false; iAmSelected = false; startAnimating = false; } } } } }