private void createGameObject() { // Create a game object to handle playback _gameObject = new GameObject("SfxrGameObject-" + (Time.realtimeSinceStartup)); fixGameObjectParent(); // Create actual audio player _audioPlayer = _gameObject.AddComponent <SfxrAudioPlayer>(); _audioPlayer.SetSfxrSynth(this); }
private void createGameObject() { // Create a game object to handle playback _gameObject = new GameObject("SfxrGameObject-" + (Time.realtimeSinceStartup)); fixGameObjectParent(); // Create actual audio player _audioPlayer = _gameObject.AddComponent <SfxrAudioPlayer>(); _audioPlayer.SetSfxrSynth(this); _audioPlayer.SetRunningInEditMode(Application.isEditor && !Application.isPlaying); }
/** * Stops the currently playing sound */ public void Stop() { if (_audioPlayer != null) { _audioPlayer.Destroy(); _audioPlayer = null; } if (_original != null) { _params.CopyFrom(_original); _original = null; } }
private void createGameObject() { // Create a game object to handle playback _gameObject = new GameObject("SfxrGameObject-" + (Time.realtimeSinceStartup)); fixGameObjectParent(); // Create actual audio player _audioPlayer = _gameObject.AddComponent<SfxrAudioPlayer>(); _audioPlayer.SetSfxrSynth(this); }
private void createGameObject() { // Create a game object to handle playback _gameObject = new GameObject("SfxrGameObject-" + (Time.realtimeSinceStartup)); fixGameObjectParent(); // Create actual audio player _audioPlayer = _gameObject.AddComponent<SfxrAudioPlayer>(); _audioPlayer.SetSfxrSynth(this); _audioPlayer.SetRunningInEditMode(Application.isEditor && !Application.isPlaying); }