public GameObject CreateAudio(string name, bool isLoop = false, bool isMusic = false) { var audio = GamePullController.CreateAudio(); audio.GetComponent <AudioSource> ().clip = ResourcesController.Load("Audio/" + name) as AudioClip; audio.GetComponent <AudioSource> ().loop = isLoop; audio.GetComponent <AudioSource> ().Play(); (isMusic?musics:sounds).Add(audio); audio.GetComponent <AudioSource> ().mute = (isMusic && !Settings.music) || (!isMusic && !Settings.sounds); if (isMusic) { audio.GetComponent <AudioSource> ().volume = 0; } return(audio); }