//Plays a Persistent Audio
        void PlayMusic()
        {
            MultiAudioSource persistentAudio = MultiAudioManager.PlayAudioObject(musicAudioObject, 3, transform.position);

            //Makes the sound persistent
            persistentAudio.PersistsBetweenScenes = true;
        }
        //Plays an Audio Object overriting some of its parameters
        void PlaySoundOverrideParameters()
        {
            MultiAudioSource sound = MultiAudioManager.PlayAudioObject(refAudioObject, transform.position);

            //Play the audio backwards
            sound.PitchOverride = -1;
            //Change the spatial mode to 2D
            sound.SpatialMode2DOverride = true;
        }
Exemple #3
0
        //This is the important part, the Custom Play Method
        public void PlayFootstep(MLPASACustomPlayMethodParameters parameters)
        {
            MultiAudioSource source = MultiAudioManager.PlayAudioObject(parameters.AudioObject, parameters.CustomParameters.IntParameter == 1?rightFoot.position:leftFoot.position);

            source.MasterVolume = speed;
        }
 public static void Play(this AudioObject ao, int channel, Transform targetToFollow, out MultiAudioSource audioSource)
 {
     audioSource = MultiAudioManager.PlayAudioObject(ao, channel, targetToFollow);
 }
 public static void Play(this AudioObject ao, int channel, Vector3 position, out MultiAudioSource audioSource)
 {
     audioSource = MultiAudioManager.PlayAudioObject(ao, channel, position);
 }
 public static void Play(this AudioObject ao, int channel, Transform targetToFollow)
 {
     MultiAudioManager.PlayAudioObject(ao, channel, targetToFollow);
 }
 public static void Play(this AudioObject ao, int channel, Vector3 position)
 {
     MultiAudioManager.PlayAudioObject(ao, channel, position);
 }
        public static void PlayIgnoringPause(this AudioObject ao, Transform trf)
        {
            MultiAudioSource source = MultiAudioManager.PlayAudioObject(ao, trf);

            source.IgnoreListenerPause = true;
        }
        public static void PlayIgnoringPause(this AudioObject ao, Vector3 position)
        {
            MultiAudioSource source = MultiAudioManager.PlayAudioObject(ao, position);

            source.IgnoreListenerPause = true;
        }
 public static void PlayWithDifferentPitch(this AudioObject ao, int channel, Transform targetToFollow, float pitchMultiplier)
 {
     MultiAudioManager.PlayAudioObject(ao, channel, targetToFollow).PitchOverride = ao.pitch * pitchMultiplier;
 }
 public static void PlayWithDifferentPitch(this AudioObject ao, int channel, Vector3 position, float pitchMultiplier)
 {
     MultiAudioManager.PlayAudioObject(ao, channel, position).PitchOverride = ao.pitch * pitchMultiplier;
 }
        public static void Play(this AudioObject ao, int channel, Vector3 position, MultiAudioManager.UpdateModes updateMode)
        {
            MultiAudioSource _source = MultiAudioManager.PlayAudioObject(ao, channel, position);

            _source.PlayUpdateMode = updateMode;
        }
        public static void Play(this AudioObject ao, Transform targetToFollow, MultiAudioManager.UpdateModes updateMode)
        {
            MultiAudioSource _source = MultiAudioManager.PlayAudioObject(ao, targetToFollow);

            _source.PlayUpdateMode = updateMode;
        }
 //Plays an Audio Object
 void PlayAudioObject()
 {
     MultiAudioManager.PlayAudioObject(refAudioObject, transform.position);
 }
 //Plays a Normal Music
 void PlayNonPersistentMusic()
 {
     MultiAudioManager.PlayAudioObject(musicAudioObject, 3, transform.position);
 }
 void Awake()
 {
     //Plays an occludable Audio Object and makes that follows the position of this GameObject
     MultiAudioManager.PlayAudioObject(bgm, transform, true);
 }