public void onEndDragLetter(CountTo10Letter letter) { animController.SetInteger("EatState", 0); if (RectTransformUtility.RectangleContainsScreenPoint((RectTransform)MonsterMouthHit.transform, Input.mousePosition, GameplayController.Instance.canvasCamera)) { // ApproveDigit (letter); letter.gotoMouth(); } else { letter.Rollback(); } }
public void ApproveDigit(CountTo10Letter letter) { if (letter.value == "" + CurrentDigit) { TutorialController.Instance.EndTutorial(); //Jonathan AudioController.Instance.PlaySound(SoundCorrectAnswers[UnityEngine.Random.Range(0, SoundCorrectAnswers.Length)]); AudioController.Instance.PlaySound(SoundEat); if (CurrentDigit + 1 >= 11) { AudioController.Instance.PlaySound(SoundCorrentLetterFinish, .35f); } else { AudioController.Instance.PlaySound(SoundCorrentLetter, .35f); } //Jonathan animController.SetInteger("EatState", 2); letters [CurrentDigit - 1].gameObject.SetActive(false); AudioClip voice = Resources.Load("Sounds/Voice/Numbers/" + letters [CurrentDigit - 1].value) as AudioClip; if (voice != null) { AudioController.Instance.PlaySound(voice, 1); } CurrentDigit++; if (CurrentDigit >= 11) { Complete(); } else { EnableCurrentDigit(); } } }