//オーディオクリップをSEとして再生 SoundSe PlaySeClip(AudioClip clip, float volume, string label, SoundPlayMode playMode) { if (string.IsNullOrEmpty(label)) { label = clip.name; } switch (playMode) { case SoundPlayMode.Add: break; case SoundPlayMode.Cancel: if (IsPlayingSe(label)) { Debug.Log("Cancel"); StopSe(label, 0.02f); } break; case SoundPlayMode.NoPlay: if (IsPlayingSe(label)) { return(null); } break; } GameObject go = UtageToolKit.AddChild(CachedTransform, new GameObject(label)); SoundSe se = go.AddComponent <SoundSe>(); se.Init(clip, volume); return(se); }