IEnumerator WaitForPlayTimeToEnd(float time) { yield return(new WaitForSeconds(time)); //animation isPlaying = false; animator.SetBool("isPlaying", false); animator.SetInteger("State", 0); interactionAnimator.SetTrigger("Play"); //update stats monsterStats.DecrementHunger(10f); monsterStats.DecrementThirst(10f); if (monsterStats.CheckHunger() > monsterStats.maxHunger / 2 && monsterStats.CheckThirst() > monsterStats.maxThirst / 2) { monsterStats.MakeMonsterHappy(10f); } PlayerManager.money += 25; StopAllCoroutines(); }