/// <summary> /// SEを再生 /// </summary> /// <param name="key">Key.</param> public void PlaySE(SEKey key) { if (!_SE_Map.ContainsKey(key)) { _SE_Map.Add(key, ResourcesManager.Instance.GetSE(_SE_PathMap [key])); } AudioSource source = _seSource.Where(x => !x.isPlaying).FirstOrDefault(); if (!source) { source = this.gameObject.AddComponent <AudioSource> (); _seSource.Add(source); } source.clip = _SE_Map [key]; source.Play(); }
public void PlaySE(SEKey key) { seAudioSource.PlayOneShot(seClipMap[key]); }