private void OnSlotPut(ContainedSlot slot) { if (slot.Item.PutSound != null) { SoundEngine.StartPlay2D(slot.Item.PutSound); } }
private ISoundVoice StartNewMoodSound(MoodSoundKey currentMood) { if (_currentlyPlayingMoodSound != null) { if (_currentlyPlayingMoodSound.IsPlaying) { _currentlyPlayingMoodSound.Stop(5000); _currentlyPlayingMoodSound = null; } } //MoodsSounds.Keys[1]. List <IUtopiaSoundSource> soundSource; if (MoodsSounds.TryGetValue(currentMood, out soundSource)) { IUtopiaSoundSource sound = soundSource[_rnd.Next(0, soundSource.Count)]; _currentlyPlayingMoodSound = SoundEngine.StartPlay2D(sound.Alias, SourceCategory.Music, false, 5000); return(_currentlyPlayingMoodSound); } else { return(null); } }