// Use this for initialization void Start() { //cesta = GameObject.FindGameObjectWithTag("cesta"); cestaAnim = cesta.GetComponent <Animator>(); isGotApple = false; levelManager = GetComponent <appleLevelManager>(); generator = GetComponent <AppleGenerator>(); goodSyllableText.text = "Busca\n" + levelManager.getGoodSyllable(); goodAppleIndicator.GetComponentInChildren <Text>().text = levelManager.getGoodSyllable(); }
void OnMouseDown() { if (appleState != "Eliminated") { transform.localScale += new Vector3(0.3f, 0.3f, 0f); if (manager.getGoodSyllable() == text) { manager.goodSelection(); particles.Play(); setAppleState("Hit"); } else { manager.badSelection(); Instantiate(failSymbol, transform.position, Quaternion.identity); failParticles = Instantiate(failParticles, transform.position, Quaternion.identity); setAppleState("Fail"); manager.changeProbability(text); } } }