Insanely huge initial commit

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

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: