public void PlayAudio(AudioType audioType) { RandomAudioClip audioPlayer = ReturnMatchingAudio(audioType); if (audioPlayer == null) { return; } audioPlayer.PlayRandomAudioClip(); }
/// <summary> /// Escalate the monster to a new danger level. /// </summary> public void Escalate() { _angrySound.PlayRandomAudioClip(); UpdateEscalation(true); Debug.Log(string.Format("Monster escalates! It is now at level {0}.", MonsterEscalationLevel), this); if ((int)MonsterEscalationLevel >= Enum.GetNames(typeof(EscalationLevel)).Length) { LoseGame(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag(Tags.FOOD)) { if (currentFoodCount < foodCount) { Debug.Log("The monster ate food.", this); eatingSounds.PlayRandomAudioClip(); Destroy(other.gameObject); monsterScript.RegisterAction(ActionType.DragAndDrop, HotSpotLocation.Teeth); } if (currentFoodCount >= foodCount) { minigameManager.CompleteCurrentMinigame(); } currentFoodCount++; } }