Пример #1
0
    public void PlayAudio(AudioType audioType)
    {
        RandomAudioClip audioPlayer = ReturnMatchingAudio(audioType);

        if (audioPlayer == null)
        {
            return;
        }

        audioPlayer.PlayRandomAudioClip();
    }
Пример #2
0
    /// <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();
        }
    }
Пример #3
0
 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++;
     }
 }