public void PoopGold() { _source.PlayOneShot(_poopAudio); print("<color=#DFEC00C6>pooping gold</color>"); GoldPoo pooTemp = Instantiate(goldPooPrefab, transform.position, Quaternion.identity); pooList.Add(pooTemp); currentPooCd = 0; bearAnimator.Play("SpawnPoo"); }
private IEnumerator EatDaPoopooCoroutine(GoldPoo poopoo, float chompTime) { while (_state == CharacterState.Mining && poopoo != null && poopoo.PooGold > 0) { _source.PlayOneShot(_eatAudio); yield return(new WaitForSeconds(chompTime)); poopoo.PooGold--; UIManager.Instance.UpdateScore(_controller, 1); if (poopoo.PooGold == 0) { poopoo.ClearPoo(); } // EAT POOPOO ANIMATION GETS TRIGGERED HERE } GetComponent <Animator>().Play("Idle"); Interrupt(); }
//callbacks private void HandlePooCleaned(GoldPoo poo) { print("found poo. Removing from list"); pooList.Remove(poo); }