public void eventReceived(IGameEvent e) { if (e is PlayMusicEvent) { PlayMusicEvent musicEvent = e as PlayMusicEvent; AudioClip audioClip = null; musicClipDictionary.TryGetValue(musicEvent.getAudioClipName(), out audioClip); if (audioClip != null) { PlayMusic(audioClip, musicEvent.doesLoop()); } } }
private void OnPlayMusic(PlayMusicEvent gameEvent) { PlayMusic(gameEvent.clip, gameEvent.loop); }