예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (!alreadyPlaying && !musicStarted)
     {
         if (music.musicMuted)
         {
             music.GetComponent <AudioSource>().clip   = Clip;
             music.GetComponent <AudioSource>().volume = Volume;
             music.GetComponent <AudioSource>().Play();
             musicStarted = true;
             Debug.Log("UnMutingMusic");
             music.musicMuted = false;
         }
     }
 }
예제 #2
0
 void Start()
 {
     music = FindObjectOfType <musicManager>();
     if (music.GetComponent <AudioSource>().clip != Clip)
     {
         music.FadeOutAS();
     }
     else
     {
         alreadyPlaying = true;
     }
 }
예제 #3
0
 public void PlayMusic(AudioClip audioClip)
 {
     MusicManager.GetComponent <AudioSource>().PlayOneShot(audioClip);
 }