public SoundPlayCommand GetSlot(ISoundData data) { // ISoundSlot unusedSlot = _slotPool.IsEmptyPool() ? ISoundSlot unusedSlot = _slotPool .Spawn() .SetGlobalVolume(_globalVolume_0_1); if (data != null) { AudioClip playClip = data.GetAudioClip(this); if (playClip == null) { Debug.LogError($"[{_monoOwner.name}.{nameof(GetSlot)}]soundKey:{data.GetSoundKey()} Clip is null", _monoOwner); } string soundCategory = data.GetSoundCategory(); string soundKey = data.GetSoundKey(); float localVolume = CalculateLocalVolume(data, soundCategory, soundKey); bool isMute = CalculateMute(soundCategory, soundKey); unusedSlot.InitSlot(playClip, soundCategory, soundKey); unusedSlot.SetLocalVolume(localVolume); unusedSlot.SetMute(isMute); } SoundPlayCommand playCommand = _commandPool.Spawn(); playCommand.Init(unusedSlot, DespawnCommand); OnPlaySound?.Invoke(unusedSlot); return(playCommand); }