private void DespawnCommand(ResourcePlayCommandBase <ISoundSlot> command) { _commandPool.DeSpawn(command as SoundPlayCommand); ISoundSlot soundSlot = command.ResourcePlayer; _slotPool.DeSpawn(soundSlot as SoundSlotComponentBase); OnFinishSound?.Invoke(soundSlot); }
private void DespawnCommand(ResourcePlayCommandBase <IEffectPlayer> command) { _commandPool.DeSpawn(command as EffectPlayCommand); EffectPlayerComponentBase returnedPlayer = command.ResourcePlayer as EffectPlayerComponentBase; string returnedEffectID = returnedPlayer.GetEffectID(); if (_effectPoolByEffectID.TryGetValue(returnedEffectID, out var effectPoolForReturnedPlayer)) { effectPoolForReturnedPlayer.DeSpawn(returnedPlayer); } else { Debug.LogError($"{nameof(EffectManager)} - effectPlayer is not contain effectPool name:{returnedPlayer}, effectID:{returnedEffectID}", returnedPlayer); } }