コード例 #1
0
        public static void Play(string name)
        {
            if (_source.isPlaying)
            {
                _source.Stop();
            }

            var audioClip = BackgroundSoundResource.GetInstance().GetAudioClip(name);

            _source.clip = audioClip;
            _source.loop = true;
            _source.Play();
        }
コード例 #2
0
 public static BackgroundSoundResource GetInstance() => _instance ?? (_instance = new BackgroundSoundResource());