Exemplo n.º 1
0
 public void StopSound(SoundTypes type)
 {
     foreach (AudioSource audio in AudioSources)
     {
         if (audio.name.Equals(type.ToString()))
         {
             audio.Stop();
             return;
         }
     }
 }
Exemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D c)
    {
        tfAnim.SetTrigger("Active");
        var result = c.CompareTag(sound.ToString());

        print("Affect Tuning: " + gameObject.name + ", Result: " + result);
        if (trick != null)
        {
            trick.Unlocked = result;
        }

        var anim = (result) ? "anim_happy" : "anim_sad";

        faceAnim.Play(anim);

        if (onNoiseCb != null)
        {
            onNoiseCb(result);
        }
    }
Exemplo n.º 3
0
 /// <summary>
 /// Funkcja zwracajaca pelna sciezke do pliku dzwiekowego (mp3) po zadanym
 /// typie dzwieku do zagrania
 /// </summary>
 /// <param name="sound">Typ dzwieku</param>
 /// <returns>Pelna sciezka do pliku wav z dzwiekiem</returns>
 public String FindSound(SoundTypes sound)
 {
     return soundDirectoryPath
         + (String)resourcesManager.GetObject(sound.ToString());
 }
Exemplo n.º 4
0
 private string GetFileName(SoundTypes file)
 {
     return((from s in Sounds
             where s.Name.ToLower().Equals(file.ToString().ToLower())
             select s.File).FirstOrDefault());
 }