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,102 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control bloom intensity and threshold over time. It requires you have in your scene an object with a PostProcessVolume
/// with Bloom active, and a MMBloomShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackHelp("This feedback allows you to control bloom intensity and threshold over time. It requires you have in your scene an object with a PostProcessVolume " +
"with Bloom active, and a MMBloomShaker component.")]
[FeedbackPath("PostProcess/Bloom")]
public class MMFeedbackBloom : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Bloom")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the feedback, in seconds
[Tooltip("the duration of the feedback, in seconds")]
public float ShakeDuration = 0.2f;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
/// whether or not to add to the initial intensity
[Tooltip("whether or not to add to the initial intensity")]
public bool RelativeValues = true;
[Header("Intensity")]
/// the curve to animate the intensity on
[Tooltip("the curve to animate the intensity on")]
public AnimationCurve ShakeIntensity = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
public float RemapIntensityZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
public float RemapIntensityOne = 1f;
[Header("Threshold")]
/// the curve to animate the threshold on
[Tooltip("the curve to animate the threshold on")]
public AnimationCurve ShakeThreshold = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
public float RemapThresholdZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
public float RemapThresholdOne = 0f;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
/// <summary>
/// Triggers a bloom shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMBloomShakeEvent.Trigger(ShakeIntensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, ShakeThreshold, RemapThresholdZero, RemapThresholdOne,
RelativeValues, intensityMultiplier, ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMBloomShakeEvent.Trigger(ShakeIntensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, ShakeThreshold,
RemapThresholdZero, RemapThresholdOne,
RelativeValues, stop:true);
}
}
}

View File

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

View File

@@ -0,0 +1,93 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control chromatic aberration intensity over time. It requires you have in your scene an object with a PostProcessVolume
/// with Chromatic Aberration active, and a MMChromaticAberrationShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackPath("PostProcess/Chromatic Aberration")]
[FeedbackHelp("This feedback allows you to control chromatic aberration intensity over time. It requires you have in your scene an object with a PostProcessVolume " +
"with Chromatic Aberration active, and a MMChromaticAberrationShaker component.")]
public class MMFeedbackChromaticAberration : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Chromatic Aberration")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the shake, in seconds
[Tooltip("the duration of the shake, in seconds")]
public float Duration = 0.2f;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(0f, 1f)]
public float RemapIntensityZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(0f, 1f)]
public float RemapIntensityOne = 1f;
[Header("Intensity")]
/// the curve to animate the intensity on
[Tooltip("the curve to animate the intensity on")]
public AnimationCurve Intensity = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the multiplier to apply to the intensity curve
[Tooltip("the multiplier to apply to the intensity curve")]
[Range(0f, 1f)]
public float Amplitude = 1.0f;
/// whether or not to add to the initial intensity
[Tooltip("whether or not to add to the initial intensity")]
public bool RelativeIntensity = false;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
/// <summary>
/// Triggers a chromatic aberration shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMChromaticAberrationShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMChromaticAberrationShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, stop:true);
}
}
}

View File

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

View File

@@ -0,0 +1,149 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control color grading post exposure, hue shift, saturation and contrast over time.
/// It requires you have in your scene an object with a PostProcessVolume
/// with Color Grading active, and a MMColorGradingShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackPath("PostProcess/Color Grading")]
[FeedbackHelp("This feedback allows you to control color grading post exposure, hue shift, saturation and contrast over time. " +
"It requires you have in your scene an object with a PostProcessVolume " +
"with Color Grading active, and a MMColorGradingShaker component.")]
public class MMFeedbackColorGrading : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Color Grading")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the shake, in seconds
[Tooltip("the duration of the shake, in seconds")]
public float ShakeDuration = 1f;
/// whether or not to add to the initial intensity
[Tooltip("whether or not to add to the initial intensity")]
public bool RelativeIntensity = true;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
[Header("Post Exposure")]
/// the curve used to animate the focus distance value on
[Tooltip("the curve used to animate the focus distance value on")]
public AnimationCurve ShakePostExposure = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
public float RemapPostExposureZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
public float RemapPostExposureOne = 1f;
[Header("Hue Shift")]
/// the curve used to animate the aperture value on
[Tooltip("the curve used to animate the aperture value on")]
public AnimationCurve ShakeHueShift = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(-180f, 180f)]
public float RemapHueShiftZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(-180f, 180f)]
public float RemapHueShiftOne = 180f;
[Header("Saturation")]
/// the curve used to animate the focal length value on
[Tooltip("the curve used to animate the focal length value on")]
public AnimationCurve ShakeSaturation = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(-100f, 100f)]
public float RemapSaturationZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(-100f, 100f)]
public float RemapSaturationOne = 100f;
[Header("Contrast")]
/// the curve used to animate the focal length value on
[Tooltip("the curve used to animate the focal length value on")]
public AnimationCurve ShakeContrast = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(-100f, 100f)]
public float RemapContrastZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(-100f, 100f)]
public float RemapContrastOne = 100f;
[MMFInspectorGroup("Color Filter", true, 50)]
/// the gradient to use to animate the color filter over time
[Tooltip("the gradient to use to animate the color filter over time")]
[GradientUsage(true)]
public Gradient ColorFilterGradient;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
/// <summary>
/// Triggers a color grading shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMColorGradingShakeEvent.Trigger(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne,
ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne,
ShakeSaturation, RemapSaturationZero, RemapSaturationOne,
ShakeContrast, RemapContrastZero, RemapContrastOne,
true, ColorFilterGradient,
FeedbackDuration,
RelativeIntensity, intensityMultiplier, ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMColorGradingShakeEvent.Trigger(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne,
ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne,
ShakeSaturation, RemapSaturationZero, RemapSaturationOne,
ShakeContrast, RemapContrastZero, RemapContrastOne,
true, ColorFilterGradient,
FeedbackDuration,
stop:true);
}
}
}

View File

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

View File

@@ -0,0 +1,124 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control depth of field focus distance, aperture and focal length over time.
/// It requires you have in your scene an object with a PostProcessVolume
/// with Depth of Field active, and a MMDepthOfFieldShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackHelp("This feedback allows you to control depth of field focus distance, aperture and focal length over time. " +
"It requires you have in your scene an object with a PostProcessVolume " +
"with Depth of Field active, and a MMDepthOfFieldShaker component.")]
[FeedbackPath("PostProcess/Depth Of Field")]
public class MMFeedbackDepthOfField : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Depth Of Field")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the shake, in seconds
[Tooltip("the duration of the shake, in seconds")]
public float ShakeDuration = 2f;
/// whether or not to add to the initial values
[Tooltip("whether or not to add to the initial values")]
public bool RelativeValues = true;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
[Header("Focus Distance")]
/// the curve used to animate the focus distance value on
[Tooltip("the curve used to animate the focus distance value on")]
public AnimationCurve ShakeFocusDistance = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
public float RemapFocusDistanceZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
public float RemapFocusDistanceOne = 3f;
[Header("Aperture")]
/// the curve used to animate the aperture value on
[Tooltip("the curve used to animate the aperture value on")]
public AnimationCurve ShakeAperture = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(0.1f, 32f)]
public float RemapApertureZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(0.1f, 32f)]
public float RemapApertureOne = 0f;
[Header("Focal Length")]
/// the curve used to animate the focal length value on
[Tooltip("the curve used to animate the focal length value on")]
public AnimationCurve ShakeFocalLength = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(0f, 300f)]
public float RemapFocalLengthZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(0f, 300f)]
public float RemapFocalLengthOne = 0f;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
/// <summary>
/// Triggers a DoF shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMDepthOfFieldShakeEvent.Trigger(ShakeFocusDistance, FeedbackDuration, RemapFocusDistanceZero, RemapFocusDistanceOne,
ShakeAperture, RemapApertureZero, RemapApertureOne,
ShakeFocalLength, RemapFocalLengthZero, RemapFocalLengthOne,
RelativeValues, intensityMultiplier, ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMDepthOfFieldShakeEvent.Trigger(ShakeFocusDistance, FeedbackDuration, RemapFocusDistanceZero, RemapFocusDistanceOne,
ShakeAperture, RemapApertureZero, RemapApertureOne,
ShakeFocalLength, RemapFocalLengthZero, RemapFocalLengthOne,
RelativeValues, stop:true);
}
}
}

View File

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

View File

@@ -0,0 +1,176 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback will let you pilot a Global PostProcessing Volume AutoBlend component. A GPPVAB component is placed on a PostProcessing Volume, and will let you control and blend its weight over time on demand.
/// </summary>
[AddComponentMenu("")]
[FeedbackHelp("This feedback will let you pilot a Global PostProcessing Volume AutoBlend component. " +
"A GPPVAB component is placed on a PostProcessing Volume, and will let you control and blend its weight over time on demand.")]
[FeedbackPath("PostProcess/Global PP Volume Auto Blend")]
public class MMFeedbackGlobalPPVolumeAutoBlend : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// the possible modes for this feedback :
/// - default : will let you trigger Blend() and BlendBack() on the blender
/// - override : lets you specify new initial, final, duration and curve values on the blender, and triggers a Blend()
public enum Modes { Default, Override }
/// the possible actions when in Default mode
public enum Actions { Blend, BlendBack }
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
/// defines the duration of the feedback
public override float FeedbackDuration
{
get
{
if (Mode == Modes.Override)
{
return BlendDuration;
}
else
{
if (TargetAutoBlend == null)
{
return 0.1f;
}
else
{
return TargetAutoBlend.BlendDuration;
}
}
}
}
[Header("PostProcess Volume Blend")]
/// the target auto blend to pilot with this feedback
[Tooltip("the target auto blend to pilot with this feedback")]
public MMGlobalPostProcessingVolumeAutoBlend TargetAutoBlend;
/// the chosen mode
[Tooltip("the chosen mode")]
public Modes Mode = Modes.Default;
/// the chosen action when in default mode
[Tooltip("the chosen action when in default mode")]
[MMFEnumCondition("Mode", (int)Modes.Default)]
public Actions BlendAction = Actions.Blend;
/// the duration of the blend, in seconds when in override mode
[Tooltip("the duration of the blend, in seconds when in override mode")]
[MMFEnumCondition("Mode", (int)Modes.Override)]
public float BlendDuration = 1f;
/// the curve to apply to the blend
[Tooltip("the curve to apply to the blend")]
[MMFEnumCondition("Mode", (int)Modes.Override)]
public AnimationCurve BlendCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1f));
/// the weight to blend from
[Tooltip("the weight to blend from")]
[MMFEnumCondition("Mode", (int)Modes.Override)]
public float InitialWeight = 0f;
/// the weight to blend to
[Tooltip("the weight to blend to")]
[MMFEnumCondition("Mode", (int)Modes.Override)]
public float FinalWeight = 1f;
/// whether or not to reset to the initial value at the end of the shake
[Tooltip("whether or not to reset to the initial value at the end of the shake")]
[MMFEnumCondition("Mode", (int)Modes.Override)]
public bool ResetToInitialValueOnEnd = true;
/// <summary>
/// On custom play, triggers a blend on the target blender, overriding its settings if needed
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_POSTPROCESSING
if (TargetAutoBlend == null)
{
Debug.LogWarning(this.name + " : this MMFeedbackGlobalPPVolumeAutoBlend needs a TargetAutoBlend, please set one in its inspector.");
return;
}
if (Mode == Modes.Default)
{
if (!NormalPlayDirection)
{
if (BlendAction == Actions.Blend)
{
TargetAutoBlend.BlendBack();
return;
}
if (BlendAction == Actions.BlendBack)
{
TargetAutoBlend.Blend();
return;
}
}
else
{
if (BlendAction == Actions.Blend)
{
TargetAutoBlend.Blend();
return;
}
if (BlendAction == Actions.BlendBack)
{
TargetAutoBlend.BlendBack();
return;
}
}
}
else
{
TargetAutoBlend.BlendDuration = BlendDuration;
TargetAutoBlend.Curve = BlendCurve;
if (!NormalPlayDirection)
{
TargetAutoBlend.InitialWeight = FinalWeight;
TargetAutoBlend.FinalWeight = InitialWeight;
}
else
{
TargetAutoBlend.InitialWeight = InitialWeight;
TargetAutoBlend.FinalWeight = FinalWeight;
}
TargetAutoBlend.ResetToInitialValueOnEnd = ResetToInitialValueOnEnd;
TargetAutoBlend.Blend();
}
#endif
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
#if MM_POSTPROCESSING
base.CustomStopFeedback(position, feedbacksIntensity);
if (TargetAutoBlend != null)
{
TargetAutoBlend.StopBlending();
}
#endif
}
}
}

View File

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

View File

@@ -0,0 +1,102 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control lens distortion intensity over time.
/// It requires you have in your scene an object with a PostProcessVolume
/// with Lens Distortion active, and a MMLensDistortionShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackPath("PostProcess/Lens Distortion")]
[FeedbackHelp("This feedback allows you to control lens distortion intensity over time. " +
"It requires you have in your scene an object with a PostProcessVolume " +
"with Lens Distortion active, and a MMLensDistortionShaker component.")]
public class MMFeedbackLensDistortion : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Lens Distortion")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the shake in seconds
[Tooltip("the duration of the shake in seconds")]
public float Duration = 0.5f;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
[Header("Intensity")]
/// whether or not to add to the initial intensity value
[Tooltip("whether or not to add to the initial intensity value")]
public bool RelativeIntensity = false;
/// the curve to animate the intensity on
[Tooltip("the curve to animate the intensity on")]
public AnimationCurve Intensity = new AnimationCurve(new Keyframe(0, 0),
new Keyframe(0.2f, 1),
new Keyframe(0.25f, -1),
new Keyframe(0.35f, 0.7f),
new Keyframe(0.4f, -0.7f),
new Keyframe(0.6f, 0.3f),
new Keyframe(0.65f, -0.3f),
new Keyframe(0.8f, 0.1f),
new Keyframe(0.85f, -0.1f),
new Keyframe(1, 0));
/// the value to remap the curve's 0 to
[Tooltip("the value to remap the curve's 0 to")]
[Range(-100f, 100f)]
public float RemapIntensityZero = 0f;
/// the value to remap the curve's 1 to
[Tooltip("the value to remap the curve's 1 to")]
[Range(-100f, 100f)]
public float RemapIntensityOne = 20f;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
/// <summary>
/// Triggers a lens distortion shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMLensDistortionShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMLensDistortionShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, stop:true);
}
}
}

View File

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

View File

@@ -0,0 +1,93 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Feedbacks;
namespace MoreMountains.FeedbacksForThirdParty
{
/// <summary>
/// This feedback allows you to control vignette intensity over time.
/// It requires you have in your scene an object with a PostProcessVolume
/// with Vignette active, and a MMVignetteShaker component.
/// </summary>
[AddComponentMenu("")]
[FeedbackPath("PostProcess/Vignette")]
[FeedbackHelp("This feedback allows you to control vignette intensity over time. " +
"It requires you have in your scene an object with a PostProcessVolume " +
"with Vignette active, and a MMVignetteShaker component.")]
public class MMFeedbackVignette : MMFeedback
{
/// a static bool used to disable all feedbacks of this type at once
public static bool FeedbackTypeAuthorized = true;
/// sets the inspector color for this feedback
#if UNITY_EDITOR
public override Color FeedbackColor { get { return MMFeedbacksInspectorColors.PostProcessColor; } }
#endif
[Header("Vignette")]
/// the channel to emit on
[Tooltip("the channel to emit on")]
public int Channel = 0;
/// the duration of the shake, in seconds
[Tooltip("the duration of the shake, in seconds")]
public float Duration = 0.2f;
/// whether or not to reset shaker values after shake
[Tooltip("whether or not to reset shaker values after shake")]
public bool ResetShakerValuesAfterShake = true;
/// whether or not to reset the target's values after shake
[Tooltip("whether or not to reset the target's values after shake")]
public bool ResetTargetValuesAfterShake = true;
[Header("Intensity")]
/// the curve to animate the intensity on
[Tooltip("the curve to animate the intensity on")]
public AnimationCurve Intensity = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
/// the value to remap the intensity's zero to
[Tooltip("the value to remap the intensity's zero to")]
[Range(0f, 1f)]
public float RemapIntensityZero = 0f;
/// the value to remap the intensity's one to
[Tooltip("the value to remap the intensity's one to")]
[Range(0f, 1f)]
public float RemapIntensityOne = 1.0f;
/// whether or not to add to the initial intensity
[Tooltip("whether or not to add to the initial intensity")]
public bool RelativeIntensity = false;
/// the duration of this feedback is the duration of the shake
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
/// <summary>
/// Triggers a vignette shake
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
MMVignetteShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
ChannelData(Channel), ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, Timing.TimescaleMode);
}
/// <summary>
/// On stop we stop our transition
/// </summary>
/// <param name="position"></param>
/// <param name="feedbacksIntensity"></param>
protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
{
if (!Active || !FeedbackTypeAuthorized)
{
return;
}
base.CustomStopFeedback(position, feedbacksIntensity);
MMVignetteShakeEvent.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, stop:true);
}
}
}

View File

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