// Start is called before the first frame update void Start() { omnom.enabled = false; potter = pot.GetComponent <PotScript>(); recipeShown = false; recipeEnd = false; timer = 0; potHints.enabled = false; plateHints.enabled = false; kiwiHints.enabled = false; chiliHints.enabled = false; eggyHints.enabled = false; timeLeft = 0; maxTime = 0; timerBar = timerBar.GetComponent <Image>(); timerBar.enabled = false; timerBar.fillAmount = 0f; reloading = false; timeScored = 0; scoring = true; HighScore.enabled = false; }
void Update() { if (Input.GetMouseButtonUp(0)) { if (potSelected != null && potOvered != null) { MushroomControlerDeVerdad mushroomSelected = potSelected.GetComponentInChildren <MushroomControlerDeVerdad>(); MushroomControlerDeVerdad mushroomTarget = potOvered.GetComponentInChildren <MushroomControlerDeVerdad>(); if (mushroomSelected != null) { mushroomSelected.transform.parent = potOvered.transform; mushroomSelected.transform.localPosition = Vector3.zero; mushroomSelected.mPos = potOvered.GetComponent <PotScript>().mPos; } if (mushroomTarget != null) { mushroomTarget.transform.parent = potSelected.transform; mushroomTarget.transform.localPosition = Vector3.zero; mushroomTarget.mPos = potSelected.GetComponent <PotScript>().mPos; } } else { if (potSelected != null) { MushroomControlerDeVerdad mushroomSelected = potSelected.GetComponentInChildren <MushroomControlerDeVerdad>(); if (mushroomSelected != null) { mushroomSelected.transform.localPosition = Vector3.zero; } } } potSelected = null; potOvered = null; } }
public void OnPotOver(PotScript pot) { potOvered = pot; Debug.Log("PotOver"); }
public void OnPotDown(PotScript pot) { potSelected = pot; Debug.Log("PotDown"); }