Insanely huge initial commit

This commit is contained in:
2026-02-21 16:40:15 -08:00
parent 208d626100
commit f74c547a13
33825 changed files with 5213498 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e27d0ce351322694c8fa535acdf6fdad
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
public enum MMSoundManagerAllSoundsControlEventTypes
{
Pause, Play, Stop, Free, FreeAllButPersistent, FreeAllLooping
}
/// <summary>
/// This event will let you pause/play/stop/free all sounds playing through the MMSoundManager at once
///
/// Example : MMSoundManagerAllSoundsControlEvent.Trigger(MMSoundManagerAllSoundsControlEventTypes.Stop);
/// will stop all sounds playing at once
/// </summary>
public struct MMSoundManagerAllSoundsControlEvent
{
public MMSoundManagerAllSoundsControlEventTypes EventType;
public MMSoundManagerAllSoundsControlEvent(MMSoundManagerAllSoundsControlEventTypes eventType)
{
EventType = eventType;
}
static MMSoundManagerAllSoundsControlEvent e;
public static void Trigger(MMSoundManagerAllSoundsControlEventTypes eventType)
{
e.EventType = eventType;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 934c751bdc1eca14bb13d3c6b311c60c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
public enum MMSoundManagerEventTypes
{
SaveSettings,
LoadSettings,
ResetSettings,
SettingsLoaded
}
/// <summary>
/// This event will let you trigger a save/load/reset on the MMSoundManager settings
///
/// Example : MMSoundManagerEvent.Trigger(MMSoundManagerEventTypes.SaveSettings);
/// will save settings.
/// </summary>
public struct MMSoundManagerEvent
{
public MMSoundManagerEventTypes EventType;
public MMSoundManagerEvent(MMSoundManagerEventTypes eventType)
{
EventType = eventType;
}
static MMSoundManagerEvent e;
public static void Trigger(MMSoundManagerEventTypes eventType)
{
e.EventType = eventType;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0f7449660378a3c4aa7ab771c5a336ea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
public enum MMSoundManagerSoundControlEventTypes
{
Pause,
Resume,
Stop,
Free
}
/// <summary>
/// An event used to control a specific sound on the MMSoundManager.
/// You can either search for it by ID, or directly pass an audiosource if you have it.
///
/// Example : MMSoundManagerSoundControlEvent.Trigger(MMSoundManagerSoundControlEventTypes.Stop, 33);
/// will cause the sound(s) with an ID of 33 to stop playing
/// </summary>
public struct MMSoundManagerSoundControlEvent
{
/// the ID of the sound to control (has to match the one used to play it)
public int SoundID;
/// the control mode
public MMSoundManagerSoundControlEventTypes MMSoundManagerSoundControlEventType;
/// the audiosource to control (if specified)
public AudioSource TargetSource;
public MMSoundManagerSoundControlEvent(MMSoundManagerSoundControlEventTypes eventType, int soundID, AudioSource source = null)
{
SoundID = soundID;
TargetSource = source;
MMSoundManagerSoundControlEventType = eventType;
}
static MMSoundManagerSoundControlEvent e;
public static void Trigger(MMSoundManagerSoundControlEventTypes eventType, int soundID, AudioSource source = null)
{
e.SoundID = soundID;
e.TargetSource = source;
e.MMSoundManagerSoundControlEventType = eventType;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c47cf85e660a3714e98c5ac0a9c153cd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// This event will let you pause
///
/// Example : MMSoundManagerSoundFadeEvent.Trigger(33, 2f, 0.3f, new MMTweenType(MMTween.MMTweenCurve.EaseInElastic));
/// will fade the sound with an ID of 33 towards a volume of 0.3, over 2 seconds, on an elastic curve
/// </summary>
public struct MMSoundManagerSoundFadeEvent
{
public enum Modes { PlayFade, StopFade }
/// whether we are fading a sound, or stopping an existing fade
public Modes Mode;
/// the ID of the sound to fade
public int SoundID;
/// the duration of the fade (in seconds)
public float FadeDuration;
/// the volume towards which to fade this sound
public float FinalVolume;
/// the tween over which to fade this sound
public MMTweenType FadeTween;
public MMSoundManagerSoundFadeEvent(Modes mode, int soundID, float fadeDuration, float finalVolume, MMTweenType fadeTween)
{
Mode = mode;
SoundID = soundID;
FadeDuration = fadeDuration;
FinalVolume = finalVolume;
FadeTween = fadeTween;
}
static MMSoundManagerSoundFadeEvent e;
public static void Trigger(Modes mode, int soundID, float fadeDuration, float finalVolume, MMTweenType fadeTween)
{
e.Mode = mode;
e.SoundID = soundID;
e.FadeDuration = fadeDuration;
e.FinalVolume = finalVolume;
e.FadeTween = fadeTween;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4b96a37932e03d84586c714caa05bf79
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
namespace MoreMountains.Tools
{
/// <summary>
/// This event will let you play a sound on the MMSoundManager
///
/// Example : MMSoundManagerSoundPlayEvent.Trigger(ExplosionSfx, MMSoundManager.MMSoundManagerTracks.Sfx, this.transform.position);
/// will play a clip (here ours is called ExplosionSfx) on the SFX track, at the position of the object calling it
/// </summary>
public struct MMSoundManagerSoundPlayEvent
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
public delegate AudioSource Delegate(AudioClip clip, MMSoundManagerPlayOptions options);
static private event Delegate OnEvent;
static public void Register(Delegate callback)
{
OnEvent += callback;
}
static public void Unregister(Delegate callback)
{
OnEvent -= callback;
}
static public AudioSource Trigger(AudioClip clip, MMSoundManagerPlayOptions options)
{
return OnEvent?.Invoke(clip, options);
}
static public AudioSource Trigger(AudioClip audioClip, MMSoundManager.MMSoundManagerTracks mmSoundManagerTrack, Vector3 location,
bool loop = false, float volume = 1.0f, int ID = 0,
bool fade = false, float fadeInitialVolume = 0f, float fadeDuration = 1f, MMTweenType fadeTween = null,
bool persistent = false,
AudioSource recycleAudioSource = null, AudioMixerGroup audioGroup = null,
float pitch = 1f, float panStereo = 0f, float spatialBlend = 0.0f,
bool soloSingleTrack = false, bool soloAllTracks = false, bool autoUnSoloOnEnd = false,
bool bypassEffects = false, bool bypassListenerEffects = false, bool bypassReverbZones = false, int priority = 128, float reverbZoneMix = 1f,
float dopplerLevel = 1f, int spread = 0, AudioRolloffMode rolloffMode = AudioRolloffMode.Logarithmic, float minDistance = 1f, float maxDistance = 500f)
{
MMSoundManagerPlayOptions options = MMSoundManagerPlayOptions.Default;
options.MmSoundManagerTrack = mmSoundManagerTrack;
options.Location = location;
options.Loop = loop;
options.Volume = volume;
options.ID = ID;
options.Fade = fade;
options.FadeInitialVolume = fadeInitialVolume;
options.FadeDuration = fadeDuration;
options.FadeTween = fadeTween;
options.Persistent = persistent;
options.RecycleAudioSource = recycleAudioSource;
options.AudioGroup = audioGroup;
options.Pitch = pitch;
options.PanStereo = panStereo;
options.SpatialBlend = spatialBlend;
options.SoloSingleTrack = soloSingleTrack;
options.SoloAllTracks = soloAllTracks;
options.AutoUnSoloOnEnd = autoUnSoloOnEnd;
options.BypassEffects = bypassEffects;
options.BypassListenerEffects = bypassListenerEffects;
options.BypassReverbZones = bypassReverbZones;
options.Priority = priority;
options.ReverbZoneMix = reverbZoneMix;
options.DopplerLevel = dopplerLevel;
options.Spread = spread;
options.RolloffMode = rolloffMode;
options.MinDistance = minDistance;
options.MaxDistance = maxDistance;
return OnEvent?.Invoke(audioClip, options);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa5bc168399356b4e8b48a498dfed282
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
public enum MMSoundManagerTrackEventTypes
{
MuteTrack,
UnmuteTrack,
SetVolumeTrack,
PlayTrack,
PauseTrack,
StopTrack,
FreeTrack
}
/// <summary>
/// This feedback will let you mute, unmute, play, pause, stop, free or set the volume of a selected track
///
/// Example : MMSoundManagerTrackEvent.Trigger(MMSoundManagerTrackEventTypes.PauseTrack,MMSoundManager.MMSoundManagerTracks.UI);
/// will pause the entire UI track
/// </summary>
public struct MMSoundManagerTrackEvent
{
/// the order to pass to the track
public MMSoundManagerTrackEventTypes TrackEventType;
/// the track to pass the order to
public MMSoundManager.MMSoundManagerTracks Track;
/// if in SetVolume mode, the volume to which to set the track to
public float Volume;
public MMSoundManagerTrackEvent(MMSoundManagerTrackEventTypes trackEventType, MMSoundManager.MMSoundManagerTracks track = MMSoundManager.MMSoundManagerTracks.Master, float volume = 1f)
{
TrackEventType = trackEventType;
Track = track;
Volume = volume;
}
static MMSoundManagerTrackEvent e;
public static void Trigger(MMSoundManagerTrackEventTypes trackEventType, MMSoundManager.MMSoundManagerTracks track = MMSoundManager.MMSoundManagerTracks.Master, float volume = 1f)
{
e.TrackEventType = trackEventType;
e.Track = track;
e.Volume = volume;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bda4c1805f4bd2f49923dfac1e1e004b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// This event will let you order the MMSoundManager to fade an entire track's sounds' volume towards the specified FinalVolume
///
/// Example : MMSoundManagerTrackFadeEvent.Trigger(MMSoundManager.MMSoundManagerTracks.Music, 2f, 0.5f, new MMTweenType(MMTween.MMTweenCurve.EaseInCubic));
/// will fade the volume of the music track towards 0.5, over 2 seconds, using an ease in cubic tween
/// </summary>
public struct MMSoundManagerTrackFadeEvent
{
public enum Modes { PlayFade, StopFade }
/// whether we are fading a sound, or stopping an existing fade
public Modes Mode;
/// the track to fade the volume of
public MMSoundManager.MMSoundManagerTracks Track;
/// the duration of the fade, in seconds
public float FadeDuration;
/// the final volume to fade towards
public float FinalVolume;
/// the tween to use when fading
public MMTweenType FadeTween;
public MMSoundManagerTrackFadeEvent(Modes mode, MMSoundManager.MMSoundManagerTracks track, float fadeDuration, float finalVolume, MMTweenType fadeTween)
{
Mode = mode;
Track = track;
FadeDuration = fadeDuration;
FinalVolume = finalVolume;
FadeTween = fadeTween;
}
static MMSoundManagerTrackFadeEvent e;
public static void Trigger(Modes mode, MMSoundManager.MMSoundManagerTracks track, float fadeDuration, float finalVolume, MMTweenType fadeTween)
{
e.Mode = mode;
e.Track = track;
e.FadeDuration = fadeDuration;
e.FinalVolume = finalVolume;
e.FadeTween = fadeTween;
MMEventManager.TriggerEvent(e);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03dee039a0942664ba28a68a924bd105
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 614edb33c38bcf949846d5675f29f9fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- settingsSo: {fileID: 11400000, guid: 07ea3ff88e1ecb84d91f58aa804badc6, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,133 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;
namespace MoreMountains.Tools
{
/// <summary>
/// This class manages an object pool of audiosources
/// </summary>
[Serializable]
public class MMSoundManagerAudioPool
{
protected List<AudioSource> _pool;
/// <summary>
/// Fills the pool with ready-to-use audiosources
/// </summary>
/// <param name="poolSize"></param>
/// <param name="parent"></param>
public virtual void FillAudioSourcePool(int poolSize, Transform parent)
{
if (_pool == null)
{
_pool = new List<AudioSource>();
}
if ((poolSize <= 0) || (_pool.Count >= poolSize))
{
return;
}
foreach (AudioSource source in _pool)
{
UnityEngine.Object.Destroy(source.gameObject);
}
for (int i = 0; i < poolSize; i++)
{
GameObject temporaryAudioHost = new GameObject("MMAudioSourcePool_"+i);
SceneManager.MoveGameObjectToScene(temporaryAudioHost.gameObject, parent.gameObject.scene);
AudioSource tempSource = temporaryAudioHost.AddComponent<AudioSource>();
MMFollowTarget followTarget = temporaryAudioHost.AddComponent<MMFollowTarget>();
followTarget.enabled = false;
followTarget.DisableSelfOnSetActiveFalse = true;
temporaryAudioHost.transform.SetParent(parent);
temporaryAudioHost.SetActive(false);
_pool.Add(tempSource);
}
}
/// <summary>
/// Disables an audio source after it's done playing
/// </summary>
/// <param name="duration"></param>
/// <param name="targetObject"></param>
/// <returns></returns>
public virtual IEnumerator AutoDisableAudioSource(float duration, AudioSource source, AudioClip clip, bool doNotAutoRecycleIfNotDonePlaying, float playbackTime, float playbackDuration)
{
while (source.time == 0 && source.isPlaying)
{
yield return null;
}
float initialWait = (playbackDuration > 0) ? playbackDuration : duration;
yield return MMCoroutine.WaitForUnscaled(initialWait);
if (source.clip != clip)
{
yield break;
}
if (doNotAutoRecycleIfNotDonePlaying)
{
float maxTime = (playbackDuration > 0) ? playbackTime + playbackDuration : source.clip.length;
while ((source.time != 0) && (source.time <= maxTime))
{
yield return null;
}
}
source.gameObject.SetActive(false);
}
/// <summary>
/// Pulls an available audio source from the pool
/// </summary>
/// <param name="poolCanExpand"></param>
/// <param name="parent"></param>
/// <returns></returns>
public virtual AudioSource GetAvailableAudioSource(bool poolCanExpand, Transform parent)
{
foreach (AudioSource source in _pool)
{
if (!source.gameObject.activeInHierarchy)
{
source.gameObject.SetActive(true);
return source;
}
}
if (poolCanExpand)
{
GameObject temporaryAudioHost = new GameObject("MMAudioSourcePool_"+_pool.Count);
SceneManager.MoveGameObjectToScene(temporaryAudioHost.gameObject, parent.gameObject.scene);
AudioSource tempSource = temporaryAudioHost.AddComponent<AudioSource>();
temporaryAudioHost.transform.SetParent(parent);
temporaryAudioHost.SetActive(true);
_pool.Add(tempSource);
return tempSource;
}
return null;
}
/// <summary>
/// Stops an audiosource and returns it to the pool
/// </summary>
/// <param name="sourceToStop"></param>
/// <returns></returns>
public virtual bool FreeSound(AudioSource sourceToStop)
{
foreach (AudioSource source in _pool)
{
if (source == sourceToStop)
{
source.Stop();
source.gameObject.SetActive(false);
return true;
}
}
return false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6ca15a4a57ce0a947835411d7c771538
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,186 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
namespace MoreMountains.Tools
{
/// <summary>
/// A class used to store options for MMSoundManager play
/// </summary>
[Serializable]
public struct MMSoundManagerPlayOptions
{
[HideInInspector]
public bool Initialized;
[Header("Track")]
/// the track on which to play the sound
public MMSoundManager.MMSoundManagerTracks MmSoundManagerTrack;
/// an audiogroup to use if you don't want to play on any of the preset tracks
public AudioMixerGroup AudioGroup;
[Header("Sound")]
/// whether or not the sound should loop
public bool Loop;
/// the volume at which to play the sound
[Range(0f,2f)]
public float Volume;
/// The pitch of the audio source.
[Range(-3f,3f)]
public float Pitch;
/// the ID of the sound, useful to find that sound again later
public int ID;
[Header("Fade")]
/// whether or not to fade the sound when playing it
public bool Fade;
/// the initial volume of the sound, before the fade
[MMCondition("Fade", true)]
public float FadeInitialVolume;
/// the duration of the fade, in seconds
[MMCondition("Fade", true)]
public float FadeDuration;
/// the tween to use when fading the sound
[MMCondition("Fade", true)]
public MMTweenType FadeTween;
/// whether or not the sound should persist over scene transitions
public bool Persistent;
/// an AudioSource to use if you don't want to pick one from the pool
public AudioSource RecycleAudioSource;
[Header("Time")]
/// The time (in seconds) at which to start playing the sound
public float PlaybackTime;
/// The time (in seconds after which to stop playing the sound
public float PlaybackDuration;
[Header("Spatial Settings")]
/// Pans a playing sound in a stereo way (left or right). This only applies to sounds that are Mono or Stereo.
[Range(-1f,1f)]
public float PanStereo;
/// Sets how much this AudioSource is affected by 3D spatialisation calculations (attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D.
[Range(0f,1f)]
public float SpatialBlend;
/// a Transform this sound can 'attach' to and follow it along as it plays
public Transform AttachToTransform;
[Header("Solo")]
/// whether or not this sound should play in solo mode over its destination track. If yes, all other sounds on that track will be muted when this sound starts playing
public bool SoloSingleTrack;
/// whether or not this sound should play in solo mode over all other tracks. If yes, all other tracks will be muted when this sound starts playing
public bool SoloAllTracks;
/// if in any of the solo modes, AutoUnSoloOnEnd will unmute the track(s) automatically once that sound stops playing
public bool AutoUnSoloOnEnd;
/// Bypass effects (Applied from filter components or global listener filters).
public bool BypassEffects;
/// When set global effects on the AudioListener will not be applied to the audio signal generated by the AudioSource. Does not apply if the AudioSource is playing into a mixer group.
public bool BypassListenerEffects;
/// When set doesn't route the signal from an AudioSource into the global reverb associated with reverb zones.
public bool BypassReverbZones;
/// Sets the priority of the AudioSource.
[Range(0, 256)]
public int Priority;
/// The amount by which the signal from the AudioSource will be mixed into the global reverb associated with the Reverb Zones.
[Range(0f,1.1f)]
public float ReverbZoneMix;
[Header("3D Sound Settings")]
/// Sets the Doppler scale for this AudioSource.
[Range(0f,5f)]
public float DopplerLevel;
/// the location at which to position the sound
public Vector3 Location;
/// Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space.
[Range(0,360)]
public int Spread;
/// Sets/Gets how the AudioSource attenuates over distance.
public AudioRolloffMode RolloffMode;
/// Within the Min distance the AudioSource will cease to grow louder in volume.
public float MinDistance;
/// (Logarithmic rolloff) MaxDistance is the distance a sound stops attenuating at.
public float MaxDistance;
/// Whether or not the source should be auto recycled if not done playing
public bool DoNotAutoRecycleIfNotDonePlaying;
/// whether or not to use a custom curve for custom volume rolloff
public bool UseCustomRolloffCurve;
/// the curve to use for custom volume rolloff if UseCustomRolloffCurve is true
[MMCondition("UseCustomRolloffCurve", true)]
public AnimationCurve CustomRolloffCurve;
/// whether or not to use a custom curve for spatial blend
public bool UseSpatialBlendCurve;
/// the curve to use for custom spatial blend if UseSpatialBlendCurve is true
[MMCondition("UseSpatialBlendCurve", true)]
public AnimationCurve SpatialBlendCurve;
/// whether or not to use a custom curve for reverb zone mix
public bool UseReverbZoneMixCurve;
/// the curve to use for custom reverb zone mix if UseReverbZoneMixCurve is true
[MMCondition("UseReverbZoneMixCurve", true)]
public AnimationCurve ReverbZoneMixCurve;
/// whether or not to use a custom curve for spread
public bool UseSpreadCurve;
/// the curve to use for custom spread if UseSpreadCurve is true
[MMCondition("UseSpreadCurve", true)]
public AnimationCurve SpreadCurve;
/// <summary>
/// A default set of options, meant to suit most common cases.
/// When using options, it's a good idea to start with that and override only what you need to.
///
/// Example :
///
/// MMSoundManagerPlayOptions options = MMSoundManagerPlayOptions.Default;
/// options.Loop = Loop;
/// options.Location = Vector3.zero;
/// options.MmSoundManagerTrack = MMSoundManager.MMSoundManagerTracks.Music;
///
/// MMSoundManagerSoundPlayEvent.Trigger(SoundClip, options);
///
/// Here we initialize a new local options set, override its loop, location and track settings, and call a play event using it
///
/// </summary>
public static MMSoundManagerPlayOptions Default
{
get
{
MMSoundManagerPlayOptions defaultOptions = new MMSoundManagerPlayOptions();
defaultOptions.Initialized = true;
defaultOptions.MmSoundManagerTrack = MMSoundManager.MMSoundManagerTracks.Sfx;
defaultOptions.Location = Vector3.zero;
defaultOptions.Loop = false;
defaultOptions.Volume = 1.0f;
defaultOptions.ID = 0;
defaultOptions.Fade = false;
defaultOptions.FadeInitialVolume = 0f;
defaultOptions.FadeDuration = 1f;
defaultOptions.FadeTween = MMTweenType.DefaultEaseInCubic;
defaultOptions.Persistent = false;
defaultOptions.RecycleAudioSource = null;
defaultOptions.AudioGroup = null;
defaultOptions.Pitch = 1f;
defaultOptions.PanStereo = 0f;
defaultOptions.SpatialBlend = 0.0f;
defaultOptions.SoloSingleTrack = false;
defaultOptions.SoloAllTracks = false;
defaultOptions.AutoUnSoloOnEnd = false;
defaultOptions.BypassEffects = false;
defaultOptions.BypassListenerEffects = false;
defaultOptions.BypassReverbZones = false;
defaultOptions.Priority = 128;
defaultOptions.ReverbZoneMix = 1f;
defaultOptions.DopplerLevel = 1f;
defaultOptions.Spread = 0;
defaultOptions.RolloffMode = AudioRolloffMode.Logarithmic;
defaultOptions.MinDistance = 1f;
defaultOptions.MaxDistance = 500f;
defaultOptions.DoNotAutoRecycleIfNotDonePlaying = true;
return defaultOptions;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 123f46c3aae9cbd4bba38e5dcf9cecae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,106 @@
using System;
using System.Collections;
using System.Collections.Generic;
using MoreMountains.Tools;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// This class stores MMSoundManager settings and lets you tweak them from the MMSoundManagerSettingsSO's inspector
/// </summary>
[Serializable]
public class MMSoundManagerSettings
{
public const float _minimalVolume = 0.0001f;
public const float _maxVolume = 10f;
public const float _defaultVolume = 1f;
[Header("Audio Mixer Control")]
/// whether or not the settings described below should override the ones defined in the AudioMixer
[Tooltip("whether or not the settings described below should override the ones defined in the AudioMixer")]
public bool OverrideMixerSettings = true;
[Header("Audio Mixer Exposed Parameters")]
/// the name of the exposed MasterVolume parameter in the AudioMixer
[Tooltip("the name of the exposed MasterVolume parameter in the AudioMixer")]
public string MasterVolumeParameter = "MasterVolume";
/// the name of the exposed MusicVolume parameter in the AudioMixer
[Tooltip("the name of the exposed MusicVolume parameter in the AudioMixer")]
public string MusicVolumeParameter = "MusicVolume";
/// the name of the exposed SfxVolume parameter in the AudioMixer
[Tooltip("the name of the exposed SfxVolume parameter in the AudioMixer")]
public string SfxVolumeParameter = "SfxVolume";
/// the name of the exposed UIVolume parameter in the AudioMixer
[Tooltip("the name of the exposed UIVolume parameter in the AudioMixer")]
public string UIVolumeParameter = "UIVolume";
[Header("Master")]
/// the master volume
[Range(_minimalVolume,_maxVolume)]
[Tooltip("the master volume")]
[MMReadOnly]
public float MasterVolume = _defaultVolume;
/// whether the master track is active at the moment or not
[Tooltip("whether the master track is active at the moment or not")]
[MMReadOnly]
public bool MasterOn = true;
/// the volume of the master track before it was muted
[Tooltip("the volume of the master track before it was muted")]
[MMReadOnly]
public float MutedMasterVolume;
[Header("Music")]
/// the music volume
[Range(_minimalVolume,_maxVolume)]
[Tooltip("the music volume")]
[MMReadOnly]
public float MusicVolume = _defaultVolume;
/// whether the music track is active at the moment or not
[Tooltip("whether the music track is active at the moment or not")]
[MMReadOnly]
public bool MusicOn = true;
/// the volume of the music track before it was muted
[Tooltip("the volume of the music track before it was muted")]
[MMReadOnly]
public float MutedMusicVolume;
[Header("Sound Effects")]
/// the sound fx volume
[Range(_minimalVolume,_maxVolume)]
[Tooltip("the sound fx volume")]
[MMReadOnly]
public float SfxVolume = _defaultVolume;
/// whether the SFX track is active at the moment or not
[Tooltip("whether the SFX track is active at the moment or not")]
[MMReadOnly]
public bool SfxOn = true;
/// the volume of the SFX track before it was muted
[Tooltip("the volume of the SFX track before it was muted")]
[MMReadOnly]
public float MutedSfxVolume;
[Header("UI")]
/// the UI sounds volume
[Range(_minimalVolume,_maxVolume)]
[Tooltip("the UI sounds volume")]
[MMReadOnly]
public float UIVolume = _defaultVolume;
/// whether the UI track is active at the moment or not
[Tooltip("whether the UI track is active at the moment or not")]
[MMReadOnly]
public bool UIOn = true;
/// the volume of the UI track before it was muted
[Tooltip("the volume of the UI track before it was muted")]
[MMReadOnly]
public float MutedUIVolume;
[Header("Save & Load")]
/// whether or not the MMSoundManager should automatically load settings when starting
[Tooltip("whether or not the MMSoundManager should automatically load settings when starting")]
public bool AutoLoad = true;
/// whether or not each change in the settings should be automaticall saved. If not, you'll have to call a save MMSoundManager event for settings to be saved.
[Tooltip("whether or not each change in the settings should be automaticall saved. If not, you'll have to call a save MMSoundManager event for settings to be saved.")]
public bool AutoSave = false;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 504ec383a394760468beec53f890add9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,210 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Audio;
namespace MoreMountains.Tools
{
/// <summary>
/// A class to save sound settings (music on or off, sfx on or off)
/// </summary>
[Serializable]
[CreateAssetMenu(menuName = "MoreMountains/Audio/MMSoundManagerSettings")]
public class MMSoundManagerSettingsSO : ScriptableObject
{
[Header("Audio Mixer")]
/// the audio mixer to use when playing sounds
[Tooltip("the audio mixer to use when playing sounds")]
public AudioMixer TargetAudioMixer;
/// the master group
[Tooltip("the master group")]
public AudioMixerGroup MasterAudioMixerGroup;
/// the group on which to play all music sounds
[Tooltip("the group on which to play all music sounds")]
public AudioMixerGroup MusicAudioMixerGroup;
/// the group on which to play all sound effects
[Tooltip("the group on which to play all sound effects")]
public AudioMixerGroup SfxAudioMixerGroup;
/// the group on which to play all UI sounds
[Tooltip("the group on which to play all UI sounds")]
public AudioMixerGroup UIAudioMixerGroup;
/// the multiplier to apply when converting normalized volume values to audio mixer values
[Tooltip("the multiplier to apply when converting normalized volume values to audio mixer values")]
public float MixerValuesMultiplier = 20;
[Header("Settings Unfold")]
/// the full settings for this MMSoundManager
[Tooltip("the full settings for this MMSoundManager")]
public MMSoundManagerSettings Settings;
protected const string _saveFolderName = "MMSoundManager/";
protected const string _saveFileName = "mmsound.settings";
#region SaveAndLoad
/// <summary>
/// Saves the sound settings to file
/// </summary>
public virtual void SaveSoundSettings()
{
MMSaveLoadManager.Save(this.Settings, _saveFileName, _saveFolderName);
}
/// <summary>
/// Loads the sound settings from file (if found)
/// </summary>
public virtual void LoadSoundSettings()
{
if (Settings.OverrideMixerSettings)
{
MMSoundManagerSettings settings =
(MMSoundManagerSettings) MMSaveLoadManager.Load(typeof(MMSoundManagerSettings), _saveFileName,
_saveFolderName);
if (settings != null)
{
this.Settings = settings;
ApplyTrackVolumes();
}
MMSoundManagerEvent.Trigger(MMSoundManagerEventTypes.SettingsLoaded);
}
}
/// <summary>
/// Resets the sound settings by destroying the save file
/// </summary>
public virtual void ResetSoundSettings()
{
MMSaveLoadManager.DeleteSave(_saveFileName, _saveFolderName);
}
#endregion
#region Volume
/// <summary>
/// sets the volume of the selected track to the value passed in parameters
/// </summary>
/// <param name="track"></param>
/// <param name="volume"></param>
public virtual void SetTrackVolume(MMSoundManager.MMSoundManagerTracks track, float volume)
{
if (volume <= 0f)
{
volume = MMSoundManagerSettings._minimalVolume;
}
switch (track)
{
case MMSoundManager.MMSoundManagerTracks.Master:
TargetAudioMixer.SetFloat(Settings.MasterVolumeParameter, NormalizedToMixerVolume(volume));
Settings.MasterVolume = volume;
break;
case MMSoundManager.MMSoundManagerTracks.Music:
TargetAudioMixer.SetFloat(Settings.MusicVolumeParameter, NormalizedToMixerVolume(volume));
Settings.MusicVolume = volume;
break;
case MMSoundManager.MMSoundManagerTracks.Sfx:
TargetAudioMixer.SetFloat(Settings.SfxVolumeParameter, NormalizedToMixerVolume(volume));
Settings.SfxVolume = volume;
break;
case MMSoundManager.MMSoundManagerTracks.UI:
TargetAudioMixer.SetFloat(Settings.UIVolumeParameter, NormalizedToMixerVolume(volume));
Settings.UIVolume = volume;
break;
}
if (Settings.AutoSave)
{
SaveSoundSettings();
}
}
/// <summary>
/// Returns the volume of the specified track
/// </summary>
/// <param name="track"></param>
/// <returns></returns>
public virtual float GetTrackVolume(MMSoundManager.MMSoundManagerTracks track)
{
float volume = 1f;
switch (track)
{
case MMSoundManager.MMSoundManagerTracks.Master:
TargetAudioMixer.GetFloat(Settings.MasterVolumeParameter, out volume);
break;
case MMSoundManager.MMSoundManagerTracks.Music:
TargetAudioMixer.GetFloat(Settings.MusicVolumeParameter, out volume);
break;
case MMSoundManager.MMSoundManagerTracks.Sfx:
TargetAudioMixer.GetFloat(Settings.SfxVolumeParameter, out volume);
break;
case MMSoundManager.MMSoundManagerTracks.UI:
TargetAudioMixer.GetFloat(Settings.UIVolumeParameter, out volume);
break;
}
return MixerVolumeToNormalized(volume);
}
/// <summary>
/// assigns the volume of each track to the settings values
/// </summary>
public virtual void GetTrackVolumes()
{
Settings.MasterVolume = GetTrackVolume(MMSoundManager.MMSoundManagerTracks.Master);
Settings.MusicVolume = GetTrackVolume(MMSoundManager.MMSoundManagerTracks.Music);
Settings.SfxVolume = GetTrackVolume(MMSoundManager.MMSoundManagerTracks.Sfx);
Settings.UIVolume = GetTrackVolume(MMSoundManager.MMSoundManagerTracks.UI);
}
/// <summary>
/// applies volume to all tracks and saves if needed
/// </summary>
protected virtual void ApplyTrackVolumes()
{
if (Settings.OverrideMixerSettings)
{
TargetAudioMixer.SetFloat(Settings.MasterVolumeParameter, NormalizedToMixerVolume(Settings.MasterVolume));
TargetAudioMixer.SetFloat(Settings.MusicVolumeParameter, NormalizedToMixerVolume(Settings.MusicVolume));
TargetAudioMixer.SetFloat(Settings.SfxVolumeParameter, NormalizedToMixerVolume(Settings.SfxVolume));
TargetAudioMixer.SetFloat(Settings.UIVolumeParameter, NormalizedToMixerVolume(Settings.UIVolume));
if (!Settings.MasterOn) { TargetAudioMixer.SetFloat(Settings.MasterVolumeParameter, -80f); }
if (!Settings.MusicOn) { TargetAudioMixer.SetFloat(Settings.MusicVolumeParameter, -80f); }
if (!Settings.SfxOn) { TargetAudioMixer.SetFloat(Settings.SfxVolumeParameter, -80f); }
if (!Settings.UIOn) { TargetAudioMixer.SetFloat(Settings.UIVolumeParameter, -80f); }
if (Settings.AutoSave)
{
SaveSoundSettings();
}
}
}
/// <summary>
/// Converts a normalized volume to the mixer group db scale
/// </summary>
/// <param name="normalizedVolume"></param>
/// <returns></returns>
public virtual float NormalizedToMixerVolume(float normalizedVolume)
{
return Mathf.Log10(normalizedVolume) * MixerValuesMultiplier;
}
/// <summary>
/// Converts mixer volume to a normalized value
/// </summary>
/// <param name="mixerVolume"></param>
/// <returns></returns>
public virtual float MixerVolumeToNormalized(float mixerVolume)
{
return (float)Math.Pow(10, (mixerVolume / MixerValuesMultiplier));
}
#endregion Volume
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa48f53704ecf834c9f5e203a06874d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// A simple struct used to store information about the sounds played by the MMSoundManager
/// </summary>
[Serializable]
public struct MMSoundManagerSound
{
/// the ID of the sound
public int ID;
/// the track the sound is being played on
public MMSoundManager.MMSoundManagerTracks Track;
/// the associated audiosource
public AudioSource Source;
/// whether or not this sound will play over multiple scenes
public bool Persistent;
public float PlaybackTime;
public float PlaybackDuration;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5f351cd555ef38d4d8b69d8be107ce7f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,195 @@
using System;
using UnityEngine;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
/// <summary>
/// You can add this class to a slider in your UI and it'll let you control a target Track volume
/// via the MMSoundManager
/// </summary>
public class MMSoundManagerTrackVolumeSlider : MonoBehaviour,
MMEventListener<MMSoundManagerEvent>,
MMEventListener<MMSoundManagerTrackEvent>,
MMEventListener<MMSoundManagerTrackFadeEvent>
{
/// <summary>
/// The possible modes this slider can be in
/// - Read : the slider will move to reflect the volume of the track
/// - Write : the value of the slider will be applied to the volume of the track
/// This slider can also listen for events (mute, unmute, fade, volume change) and automatically switch to read mode
/// if one is caught. This means that most of the time, the slider is in write mode, and switches to read mode only
/// when needed, to be always accurate
/// </summary>
public enum Modes { Read, Write }
[Header("Track Volume Settings")]
/// The track to change volume on
[Tooltip("The track to change volume on")]
public MMSoundManager.MMSoundManagerTracks Track;
/// The volume to apply to the track when the slider is at its minimum
[Tooltip("The volume to apply to the track when the slider is at its minimum")]
public float MinVolume = 0f;
/// The volume to apply to the track when the slider is at its maximum
[Tooltip("The volume to apply to the track when the slider is at its maximum")]
public float MaxVolume = 1f;
[Header("Read/Write Mode")]
/// in read mode, the value of the slider will be applied to the volume of the track. in read mode, the slider will move to reflect the volume of the track
[Tooltip("in read mode, the value of the slider will be applied to the volume of the track. in read mode, the slider will move to reflect the volume of the track")]
public Modes Mode = Modes.Write;
/// if this is true, the slider will automatically switch to read mode for the required duration when a track fade event is caught
[Tooltip("if this is true, the slider will automatically switch to read mode for the required duration when a track fade event is caught")]
public bool ChangeModeOnTrackFade = true;
/// if this is true, the slider will automatically switch to read mode for the required duration when a track mute event is caught
[Tooltip("if this is true, the slider will automatically switch to read mode for the required duration when a track mute event is caught")]
public bool ChangeModeOnMute = true;
/// if this is true, the slider will automatically switch to read mode for the required duration when a track unmute event is caught
[Tooltip("if this is true, the slider will automatically switch to read mode for the required duration when a track unmute event is caught")]
public bool ChangeModeOnUnmute = true;
/// if this is true, the slider will automatically switch to read mode for the required duration when a track volume change event is caught
[Tooltip("if this is true, the slider will automatically switch to read mode for the required duration when a track volume change event is caught")]
public bool ChangeModeOnTrackVolumeChange = false;
/// when switching automatically (and temporarily) to Read Mode, the minimum duration the slider will remain in that mode
[Tooltip("when switching automatically (and temporarily) to Read Mode, the minimum duration the slider will remain in that mode")]
public float ModeSwitchBufferTime = 0.1f;
protected Slider _slider;
protected Modes _resetToMode;
protected bool _resetNeeded = false;
protected float _resetTimestamp;
/// <summary>
/// On awake we cache our slider
/// </summary>
protected virtual void Awake()
{
_slider = this.gameObject.GetComponent<Slider>();
}
/// <summary>
/// On late update, we update our slider's value if in read mode, and reset our mode if needed
/// </summary>
protected virtual void LateUpdate()
{
if (Mode == Modes.Read)
{
float trackVolume = MMSoundManager.Instance.GetTrackVolume(Track, false);
_slider.value = trackVolume;
}
if (_resetNeeded && (Time.unscaledTime >= _resetTimestamp))
{
Mode = _resetToMode;
_resetNeeded = false;
}
}
/// <summary>
/// A public method you can use to switch to read mode for a limited time, resetting to write after that
/// </summary>
/// <param name="duration"></param>
public virtual void ChangeModeToRead(float duration)
{
_resetToMode = Modes.Write;
Mode = Modes.Read;
_resetTimestamp = Time.unscaledTime + duration;
_resetNeeded = true;
}
/// <summary>
/// Bind your slider to this method
/// </summary>
public virtual void UpdateVolume(float newValue)
{
if (Mode == Modes.Read)
{
return;
}
float newVolume = MMMaths.Remap(newValue, 0f, 1f, MinVolume, MaxVolume);
MMSoundManagerTrackEvent.Trigger(MMSoundManagerTrackEventTypes.SetVolumeTrack, Track, newVolume);
}
/// <summary>
/// When we get an event letting us know the settings have been loaded, we update our slider to reflect the current track volume
/// </summary>
/// <param name="soundManagerEvent"></param>
public void OnMMEvent(MMSoundManagerEvent soundManagerEvent)
{
if (soundManagerEvent.EventType == MMSoundManagerEventTypes.SettingsLoaded)
{
UpdateSliderValueWithTrackVolume();
}
}
/// <summary>
/// Updates the slider value to reflect the current track volume
/// </summary>
public virtual void UpdateSliderValueWithTrackVolume()
{
_slider.value = MMMaths.Remap(MMSoundManager.Instance.GetTrackVolume(Track, false), 0f, 1f, MinVolume, MaxVolume);
}
/// <summary>
/// if we grab a track event, we switch to read mode if needed
/// </summary>
/// <param name="trackEvent"></param>
public void OnMMEvent(MMSoundManagerTrackEvent trackEvent)
{
switch (trackEvent.TrackEventType)
{
case MMSoundManagerTrackEventTypes.MuteTrack:
if (ChangeModeOnMute)
{
ChangeModeToRead(ModeSwitchBufferTime);
}
break;
case MMSoundManagerTrackEventTypes.UnmuteTrack:
if (ChangeModeOnUnmute)
{
ChangeModeToRead(ModeSwitchBufferTime);
}
break;
case MMSoundManagerTrackEventTypes.SetVolumeTrack:
if (ChangeModeOnTrackVolumeChange)
{
ChangeModeToRead(ModeSwitchBufferTime);
}
break;
}
}
/// <summary>
/// if we grab a track fade event, we switch to read mode if needed
/// </summary>
/// <param name="fadeEvent"></param>
public void OnMMEvent(MMSoundManagerTrackFadeEvent fadeEvent)
{
if (ChangeModeOnTrackFade)
{
ChangeModeToRead(fadeEvent.FadeDuration + ModeSwitchBufferTime);
}
}
/// <summary>
/// On enable we start listening for events
/// </summary>
protected virtual void OnEnable()
{
this.MMEventStartListening<MMSoundManagerEvent>();
this.MMEventStartListening<MMSoundManagerTrackEvent>();
this.MMEventStartListening<MMSoundManagerTrackFadeEvent>();
}
/// <summary>
/// On disable we stop listening for events
/// </summary>
protected virtual void OnDisable()
{
this.MMEventStopListening<MMSoundManagerEvent>();
this.MMEventStopListening<MMSoundManagerTrackEvent>();
this.MMEventStopListening<MMSoundManagerTrackFadeEvent>();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 487bb7f14f728c74ca3bfc0020509b6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2fafbd11d20ac5e4c8a268445549fe64
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,185 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!244 &-4576635800020724519
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: 0035689472bad0c428c533b0be360a9c
m_EffectName: Attenuation
m_MixLevel: 0523e55fe65fca847af0ff87fc3e2f3e
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!243 &-3783893103257190392
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI
m_AudioMixer: {fileID: 24100000}
m_GroupID: 39aa7f1a81fc93045baa62f351379f1b
m_Children: []
m_Volume: 6b54e6bee2cbfc5408b1e9a970814b35
m_Pitch: 78268b4570bb375429c64ce14ed21608
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: 5731139238567193833}
m_UserColorIndex: 6
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &-3165942800488051908
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sfx
m_AudioMixer: {fileID: 24100000}
m_GroupID: 8d8d3def649fd3b49ba6ebeb6b0f1029
m_Children: []
m_Volume: 534e52a4a366075458077c0854e78569
m_Pitch: 502a12b576dde844491815d64d1c4531
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: -4576635800020724519}
m_UserColorIndex: 3
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &-2273146209696275378
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Music
m_AudioMixer: {fileID: 24100000}
m_GroupID: 5c8f408e844ac0647b599b8ec8c96f5c
m_Children: []
m_Volume: c2e19a843805c3a4ca00e7acf8b2ba84
m_Pitch: a80843d39fe3901479d44fa0b40f4d60
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: 8563443583662627042}
m_UserColorIndex: 1
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!241 &24100000
AudioMixerController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MMSoundManagerAudioMixer
m_OutputGroup: {fileID: 0}
m_MasterGroup: {fileID: 24300002}
m_Snapshots:
- {fileID: 24500006}
m_StartSnapshot: {fileID: 24500006}
m_SuspendThreshold: -80
m_EnableSuspend: 1
m_UpdateMode: 0
m_ExposedParameters:
- guid: 0f44e1c042b36e646938a885f8d57ea3
name: MasterVolume
- guid: c2e19a843805c3a4ca00e7acf8b2ba84
name: MusicVolume
- guid: 534e52a4a366075458077c0854e78569
name: SfxVolume
- guid: 6b54e6bee2cbfc5408b1e9a970814b35
name: UiVolume
m_AudioMixerGroupViews:
- guids:
- 2c09fe8489093d84eb269d15e44106a0
- 5c8f408e844ac0647b599b8ec8c96f5c
- 8d8d3def649fd3b49ba6ebeb6b0f1029
- 39aa7f1a81fc93045baa62f351379f1b
name: View
m_CurrentViewIndex: 0
m_TargetSnapshot: {fileID: 24500006}
--- !u!243 &24300002
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Master
m_AudioMixer: {fileID: 24100000}
m_GroupID: 2c09fe8489093d84eb269d15e44106a0
m_Children:
- {fileID: -2273146209696275378}
- {fileID: -3165942800488051908}
- {fileID: -3783893103257190392}
m_Volume: 0f44e1c042b36e646938a885f8d57ea3
m_Pitch: f75e977dcda787e4283bdfd2e0fbd835
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: 24400004}
m_UserColorIndex: 8
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!244 &24400004
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: 7dc96f4113679f544a75c528d0f85b47
m_EffectName: Attenuation
m_MixLevel: f11780d0b2aaa304183d250aaf941743
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!245 &24500006
AudioMixerSnapshotController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Snapshot
m_AudioMixer: {fileID: 24100000}
m_SnapshotID: e34bbd4b8f6f0a34491e4d36d702e6f6
m_FloatValues:
0f44e1c042b36e646938a885f8d57ea3: 0
c2e19a843805c3a4ca00e7acf8b2ba84: 0
534e52a4a366075458077c0854e78569: 0
6b54e6bee2cbfc5408b1e9a970814b35: 0
m_TransitionOverrides: {}
--- !u!244 &5731139238567193833
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: f022f94adadb655468a67368350bbdbb
m_EffectName: Attenuation
m_MixLevel: 40e95a1bf00f08941905242957d20f00
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &8563443583662627042
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: fe11159c9acdb3d43b19af8fbdc26ff9
m_EffectName: Attenuation
m_MixLevel: cb4222fa13b8c2c439912f02c6159aaa
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7e984f512e89b60468e829489e8883e3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 24100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa48f53704ecf834c9f5e203a06874d3, type: 3}
m_Name: MMSoundManagerSettings
m_EditorClassIdentifier:
TargetAudioMixer: {fileID: 24100000, guid: 7e984f512e89b60468e829489e8883e3, type: 2}
MasterAudioMixerGroup: {fileID: 24300002, guid: 7e984f512e89b60468e829489e8883e3,
type: 2}
MusicAudioMixerGroup: {fileID: -2273146209696275378, guid: 7e984f512e89b60468e829489e8883e3,
type: 2}
SfxAudioMixerGroup: {fileID: -3165942800488051908, guid: 7e984f512e89b60468e829489e8883e3,
type: 2}
UIAudioMixerGroup: {fileID: -3783893103257190392, guid: 7e984f512e89b60468e829489e8883e3,
type: 2}
Settings:
OverrideMixerSettings: 1
MasterVolumeParameter: MasterVolume
MusicVolumeParameter: MusicVolume
SfxVolumeParameter: SfxVolume
UIVolumeParameter: UiVolume
MasterVolume: 1
MasterOn: 1
MutedMasterVolume: 0
MusicVolume: 0.2
MusicOn: 1
MutedMusicVolume: 0
SfxVolume: 1
SfxOn: 1
MutedSfxVolume: 0
UIVolume: 1
UIOn: 1
MutedUIVolume: 0
AutoLoad: 1
AutoSave: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 07ea3ff88e1ecb84d91f58aa804badc6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant: