Beispiel #1
0
 private IEnumerator InnerShow()
 {
     FMODUtil.PlayOneShot(loadingStartSound);
     for (int i = 0; i < playerElements.Count; i++)
     {
         playerElements[i].FadeIn();
         yield return(new WaitForSeconds(fadeInTime * 0.25f));
     }
     yield return(new WaitForSeconds(fadeInTime * 0.75f));
 }
Beispiel #2
0
 /// <summary>
 /// Plays a sound.
 /// </summary>
 /// <param name="sound">The sound to be played.</param>
 public void PlaySound(Sound sound)
 {
     for (int i = 0; i < sounds.Length; i++)
     {
         if (sounds[i].sound == sound)
         {
             FMODUtil.PlayOneShot(sounds[i].eventName);
             return;
         }
     }
     throw new System.Exception("Sound " + sound + " not found!");
 }
Beispiel #3
0
    private IEnumerator InnerHide()
    {
        FMODUtil.PlayOneShot(loadingEndSound);
        for (int i = 0; i < playerElements.Count; i++)
        {
            playerElements[i].FadeOut();
            yield return(new WaitForSeconds(fadeOutTime * 0.25f));
        }
        yield return(new WaitForSeconds(fadeOutTime * 0.75f));

        for (int i = 0; i < playerElements.Count; i++)
        {
            Destroy(playerElements[i].gameObject);
        }
        playerElements.Clear();
        gameObject.SetActive(false);
    }