Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    /**
     * Stops the currently playing sound
     */
    public void Stop()
    {
        if (_audioPlayer != null)
        {
            _audioPlayer.Destroy();
            _audioPlayer = null;
        }

        if (_original != null)
        {
            _params.CopyFrom(_original);
            _original = null;
        }
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
    /**
     * Stops the currently playing sound
     */
    public void Stop()
    {
        if (_audioPlayer != null) {
            _audioPlayer.Destroy();
            _audioPlayer = null;
        }

        if (_original != null) {
            _params.CopyFrom(_original);
            _original = null;
        }
    }
Ejemplo n.º 6
0
	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);
	}