chore: initial commit
This commit is contained in:
132
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Bloom_HDRP.cs
vendored
Normal file
132
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Bloom_HDRP.cs
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
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 Volume with Bloom active, and a MMBloomShaker_HDRP 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 Volume " +
|
||||
"with Bloom active, and a MMBloomShaker_HDRP component.")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Bloom HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
public class MMF_Bloom_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Bloom", true, 3)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 4)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Threshold", true, 5)]
|
||||
/// 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;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a bloom shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
attenuation = ComputeIntensity(attenuation, position);
|
||||
|
||||
MMBloomShakeEvent_HDRP.Trigger(ShakeIntensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, ShakeThreshold, RemapThresholdZero, RemapThresholdOne,
|
||||
RelativeValues, attenuation, ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
|
||||
}
|
||||
|
||||
/// <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_HDRP.Trigger(ShakeIntensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, ShakeThreshold, RemapThresholdZero, RemapThresholdOne,
|
||||
RelativeValues, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMBloomShakeEvent_HDRP.Trigger(ShakeIntensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, ShakeThreshold, RemapThresholdZero, RemapThresholdOne,
|
||||
RelativeValues, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<Bloom, MMBloomShaker_HDRP>(Owner, "Bloom");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Bloom_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Bloom_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 979e16096485bd645b1d47e00aabc982
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
157
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChannelMixer_HDRP.cs
vendored
Normal file
157
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChannelMixer_HDRP.cs
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control channel mixer's red, green and blue over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Channel Mixer active, and a MMChannelMixerShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Channel Mixer HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control channel mixer's red, green and blue over time." +
|
||||
"It requires you have in your scene an object with a Volume" +
|
||||
"with Channel Mixer active, and a MM Channel Mixer HDRP component.")]
|
||||
public class MMF_ChannelMixer_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Color Grading", true, 10)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Red", true, 13)]
|
||||
/// the curve used to animate the red value on
|
||||
[Tooltip("the curve used to animate the red value on")]
|
||||
public AnimationCurve ShakeRed = 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(-200f, 200f)]
|
||||
public float RemapRedZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[Range(-200f, 200f)]
|
||||
public float RemapRedOne = 200f;
|
||||
|
||||
[MMFInspectorGroup("Green", true, 12)]
|
||||
/// the curve used to animate the green value on
|
||||
[Tooltip("the curve used to animate the green value on")]
|
||||
public AnimationCurve ShakeGreen = 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(-200f, 200f)]
|
||||
public float RemapGreenZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[Range(-200f, 200f)]
|
||||
public float RemapGreenOne = 200f;
|
||||
|
||||
[MMFInspectorGroup("Blue", true, 11)]
|
||||
/// the curve used to animate the blue value on
|
||||
[Tooltip("the curve used to animate the blue value on")]
|
||||
public AnimationCurve ShakeBlue = 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(-200f, 200f)]
|
||||
public float RemapBlueZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[Range(-200f, 200f)]
|
||||
public float RemapBlueOne = 200f;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a color adjustments shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMChannelMixerShakeEvent_HDRP.Trigger(ShakeRed, RemapRedZero, RemapRedOne,
|
||||
ShakeGreen, RemapGreenZero, RemapGreenOne,
|
||||
ShakeBlue, RemapBlueZero, RemapBlueOne,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, intensityMultiplier, ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
MMChannelMixerShakeEvent_HDRP.Trigger(ShakeRed, RemapRedZero, RemapRedOne,
|
||||
ShakeGreen, RemapGreenZero, RemapGreenOne,
|
||||
ShakeBlue, RemapBlueZero, RemapBlueOne,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMChannelMixerShakeEvent_HDRP.Trigger(ShakeRed, RemapRedZero, RemapRedOne,
|
||||
ShakeGreen, RemapGreenZero, RemapGreenOne,
|
||||
ShakeBlue, RemapBlueZero, RemapBlueOne,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<ChannelMixer, MMChannelMixerShaker_HDRP>(Owner, "Channel Mixer");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChannelMixer_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChannelMixer_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a8a0c934ca68d7418c2a935f4d8f7c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
124
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChromaticAberration_HDRP.cs
vendored
Normal file
124
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ChromaticAberration_HDRP.cs
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
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 Volume
|
||||
/// with HDRP Chromatic Aberration active, and a MMChromaticAberrationShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Chromatic Aberration HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control chromatic aberration intensity over time. It requires you have in your scene an object with a Volume " +
|
||||
"with Chromatic Aberration active, and a MMChromaticAberrationShaker_HDRP component.")]
|
||||
public class MMF_ChromaticAberration_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Chromatic Aberration", true, 10)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 11)]
|
||||
/// 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;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a chromatic aberration shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMChromaticAberrationShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMChromaticAberrationShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<ChromaticAberration, MMChromaticAberrationShaker_HDRP>(Owner, "ChromaticAberration");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3631f6ce0e380d74295fbb1d1f9ebbb8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
202
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ColorAdjustments_HDRP.cs
vendored
Normal file
202
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_ColorAdjustments_HDRP.cs
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control color adjustments' post exposure, hue shift, saturation and contrast over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Color Adjustments active, and a MMColorAdjustmentsShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Color Adjustments HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control color adjustments' post exposure, hue shift, saturation and contrast over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Color Adjustments active, and a MMColorAdjustmentsShaker_HDRP component.")]
|
||||
public class MMF_ColorAdjustments_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Color Grading", true, 16)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Post Exposure", true, 15)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Hue Shift", true, 14)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Saturation", true, 13)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Contrast", true, 12)]
|
||||
/// 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;
|
||||
|
||||
[Header("Color Filter")]
|
||||
/// the selected color filter mode :
|
||||
/// None : nothing will happen,
|
||||
/// gradient : evaluates the color over time on that gradient, from left to right,
|
||||
/// interpolate : lerps from the current color to the destination one
|
||||
[Tooltip("the selected color filter mode :" +
|
||||
"None : nothing will happen," +
|
||||
"gradient : evaluates the color over time on that gradient, from left to right," +
|
||||
"interpolate : lerps from the current color to the destination one ")]
|
||||
public MMColorAdjustmentsShaker_HDRP.ColorFilterModes ColorFilterMode = MMColorAdjustmentsShaker_HDRP.ColorFilterModes.None;
|
||||
/// the gradient to use to animate the color filter over time
|
||||
[Tooltip("the gradient to use to animate the color filter over time")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int)MMColorAdjustmentsShaker_HDRP.ColorFilterModes.Gradient)]
|
||||
[GradientUsage(true)]
|
||||
public Gradient ColorFilterGradient;
|
||||
/// the destination color when in interpolate mode
|
||||
[Tooltip("the destination color when in interpolate mode")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int) MMColorAdjustmentsShaker_HDRP.ColorFilterModes.Interpolate)]
|
||||
public Color ColorFilterDestination = Color.yellow;
|
||||
/// the curve to use when interpolating towards the destination color
|
||||
[Tooltip("the curve to use when interpolating towards the destination color")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int) MMColorAdjustmentsShaker_HDRP.ColorFilterModes.Interpolate)]
|
||||
public AnimationCurve ColorFilterCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a color adjustments shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMColorAdjustmentsShakeEvent_HDRP.Trigger(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne,
|
||||
ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne,
|
||||
ShakeSaturation, RemapSaturationZero, RemapSaturationOne,
|
||||
ShakeContrast, RemapContrastZero, RemapContrastOne,
|
||||
ColorFilterMode, ColorFilterGradient, ColorFilterDestination, ColorFilterCurve,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, intensityMultiplier, ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
MMColorAdjustmentsShakeEvent_HDRP.Trigger(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne,
|
||||
ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne,
|
||||
ShakeSaturation, RemapSaturationZero, RemapSaturationOne,
|
||||
ShakeContrast, RemapContrastZero, RemapContrastOne,
|
||||
ColorFilterMode, ColorFilterGradient, ColorFilterDestination, ColorFilterCurve,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMColorAdjustmentsShakeEvent_HDRP.Trigger(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne,
|
||||
ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne,
|
||||
ShakeSaturation, RemapSaturationZero, RemapSaturationOne,
|
||||
ShakeContrast, RemapContrastZero, RemapContrastOne,
|
||||
ColorFilterMode, ColorFilterGradient, ColorFilterDestination, ColorFilterCurve,
|
||||
FeedbackDuration,
|
||||
RelativeIntensity, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<ColorAdjustments, MMColorAdjustmentsShaker_HDRP>(Owner, "ColorAdjustments");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e5152d83c531f540987d09bea4675bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
199
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_DepthOfField_HDRP.cs
vendored
Normal file
199
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_DepthOfField_HDRP.cs
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP Depth of Field focus distance or near/far ranges over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Depth of Field active, and a MMDepthOfFieldShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Depth of Field HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control HDRP Depth of Field focus distance or near/far ranges over time." +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Depth of Field active, and a MMDepthOfFieldShaker_HDRP component.")]
|
||||
public class MMF_DepthOfField_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Depth of Field", true, 28)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Focus Distance", true, 53)]
|
||||
/// whether or not to animate the focus distance
|
||||
[Tooltip("whether or not to animate the focus distance")]
|
||||
public bool AnimateFocusDistance = true;
|
||||
/// the curve used to animate the focus distance value on
|
||||
[Tooltip("the curve used to animate the focus distance value on")]
|
||||
[MMFCondition("AnimateFocusDistance", true)]
|
||||
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")]
|
||||
[MMFCondition("AnimateFocusDistance", true)]
|
||||
public float RemapFocusDistanceZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[MMFCondition("AnimateFocusDistance", true)]
|
||||
public float RemapFocusDistanceOne = 3f;
|
||||
|
||||
|
||||
[MMFInspectorGroup("Near Range", true, 52)]
|
||||
|
||||
[Header("Near Range Start")]
|
||||
/// whether or not to animate the near range start
|
||||
[Tooltip("whether or not to animate the near range start")]
|
||||
public bool AnimateNearRangeStart = false;
|
||||
/// the curve used to animate the near range start on
|
||||
[Tooltip("the curve used to animate the near range start on")]
|
||||
[MMFCondition("AnimateNearRangeStart", true)]
|
||||
public AnimationCurve ShakeNearRangeStart = 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")]
|
||||
[MMFCondition("AnimateNearRangeStart", true)]
|
||||
public float RemapNearRangeStartZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[MMFCondition("AnimateNearRangeStart", true)]
|
||||
public float RemapNearRangeStartOne = 3f;
|
||||
|
||||
[Header("Near Range End")]
|
||||
/// whether or not to animate the near range end
|
||||
[Tooltip("whether or not to animate the near range end")]
|
||||
public bool AnimateNearRangeEnd = false;
|
||||
/// the curve used to animate the near range end on
|
||||
[Tooltip("the curve used to animate the near range end on")]
|
||||
[MMFCondition("AnimateNearRangeEnd", true)]
|
||||
public AnimationCurve ShakeNearRangeEnd = 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")]
|
||||
[MMFCondition("AnimateNearRangeEnd", true)]
|
||||
public float RemapNearRangeEndZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[MMFCondition("AnimateNearRangeEnd", true)]
|
||||
public float RemapNearRangeEndOne = 3f;
|
||||
|
||||
[MMFInspectorGroup("Far Range", true, 51)]
|
||||
|
||||
[Header("Far Range Start")]
|
||||
/// whether or not to animate the far range start
|
||||
[Tooltip("whether or not to animate the far range start")]
|
||||
public bool AnimateFarRangeStart = false;
|
||||
/// the curve used to animate the far range start on
|
||||
[Tooltip("the curve used to animate the far range start on")]
|
||||
[MMFCondition("AnimateFarRangeStart", true)]
|
||||
public AnimationCurve ShakeFarRangeStart = 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")]
|
||||
[MMFCondition("AnimateFarRangeStart", true)]
|
||||
public float RemapFarRangeStartZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[MMFCondition("AnimateFarRangeStart", true)]
|
||||
public float RemapFarRangeStartOne = 3f;
|
||||
|
||||
[Header("Far Range End")]
|
||||
/// whether or not to animate the far range end
|
||||
[Tooltip("whether or not to animate the far range end")]
|
||||
public bool AnimateFarRangeEnd = false;
|
||||
/// the curve used to animate the far range end on
|
||||
[Tooltip("the curve used to animate the far range end on")]
|
||||
[MMFCondition("AnimateFarRangeEnd", true)]
|
||||
public AnimationCurve ShakeFarRangeEnd = 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")]
|
||||
[MMFCondition("AnimateFarRangeEnd", true)]
|
||||
public float RemapFarRangeEndZero = 0f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
[MMFCondition("AnimateFarRangeEnd", true)]
|
||||
public float RemapFarRangeEndOne = 3f;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a vignette shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMDepthOfFieldShakeEvent_HDRP.Trigger(Duration, intensityMultiplier, ChannelData, ResetShakerValuesAfterShake,
|
||||
ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode, false, false,
|
||||
AnimateFocusDistance, ShakeFocusDistance, RemapFocusDistanceZero, RemapFocusDistanceOne,
|
||||
AnimateNearRangeStart, ShakeNearRangeStart, RemapNearRangeStartZero, RemapNearRangeStartOne,
|
||||
AnimateNearRangeEnd, ShakeNearRangeEnd, RemapNearRangeEndZero, RemapNearRangeEndOne,
|
||||
AnimateFarRangeStart, ShakeFarRangeStart, RemapFarRangeStartZero, RemapFarRangeStartOne,
|
||||
AnimateFarRangeEnd, ShakeFarRangeEnd,RemapFarRangeEndZero,RemapFarRangeEndOne);
|
||||
}
|
||||
|
||||
/// <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_HDRP.Trigger(Duration, channelData: ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMDepthOfFieldShakeEvent_HDRP.Trigger(Duration, channelData: ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<DepthOfField, MMDepthOfFieldShaker_HDRP>(Owner, "DepthOfField");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_DepthOfField_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_DepthOfField_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7aa06285ee4b40b458022beb52aa9f94
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
123
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Exposure_HDRP.cs
vendored
Normal file
123
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Exposure_HDRP.cs
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP exposure intensity over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Exposure active, and a MMExposureShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Exposure HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control Exposure intensity over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Exposure active, and a MMExposureShaker_HDRP component.")]
|
||||
public class MMF_Exposure_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Exposure", true, 17)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 18)]
|
||||
/// the curve to animate the intensity on
|
||||
[Tooltip("the curve to animate the intensity on")]
|
||||
public AnimationCurve FixedExposure = 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 RemapFixedExposureZero = 8.5f;
|
||||
/// the value to remap the curve's 1 to
|
||||
[Tooltip("the value to remap the curve's 1 to")]
|
||||
public float RemapFixedExposureOne = 6f;
|
||||
/// whether or not to add to the initial intensity
|
||||
[Tooltip("whether or not to add to the initial intensity")]
|
||||
public bool RelativeFixedExposure = false;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a Exposure shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMExposureShakeEvent_HDRP.Trigger(FixedExposure, FeedbackDuration, RemapFixedExposureZero, RemapFixedExposureOne, RelativeFixedExposure, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
MMExposureShakeEvent_HDRP.Trigger(FixedExposure, FeedbackDuration, RemapFixedExposureZero,
|
||||
RemapFixedExposureOne, RelativeFixedExposure, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMExposureShakeEvent_HDRP.Trigger(FixedExposure, FeedbackDuration, RemapFixedExposureZero,
|
||||
RemapFixedExposureOne, RelativeFixedExposure, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<Exposure, MMExposureShaker_HDRP>(Owner, "Exposure");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Exposure_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Exposure_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbc9fda1740ba45499291b2e305fee54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
122
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_FilmGrain_HDRP.cs
vendored
Normal file
122
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_FilmGrain_HDRP.cs
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP Film Grain intensity over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Film Grain active, and a MMFilmGrainShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Film Grain HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control Film Grain intensity over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Film Grain active, and a MMFilmGrainShaker_HDRP component.")]
|
||||
public class MMF_FilmGrain_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Film Grain", true, 20)]
|
||||
/// the duration of the shake, in seconds
|
||||
[Tooltip("the duration of the shake, in seconds")]
|
||||
public float Duration = 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 21)]
|
||||
/// 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 curve's zero to
|
||||
[Tooltip("the value to remap the curve's zero to")]
|
||||
[Range(0f, 1f)]
|
||||
public float RemapIntensityZero = 0f;
|
||||
/// the value to remap the curve's one to
|
||||
[Tooltip("the value to remap the curve'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;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a Film Grain shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMFilmGrainShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
MMFilmGrainShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMFilmGrainShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<FilmGrain, MMFilmGrainShaker_HDRP>(Owner, "FilmGrain");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_FilmGrain_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_FilmGrain_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1abead95d414bfc41842b81d3822dd9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
133
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_LensDistortion_HDRP.cs
vendored
Normal file
133
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_LensDistortion_HDRP.cs
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP lens distortion intensity over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Lens Distortion active, and a MMLensDistortionShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Lens Distortion HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control HDRP lens distortion intensity over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Lens Distortion active, and a MMLensDistortionShaker_HDRP component.")]
|
||||
public class MMF_LensDistortion_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Lens Distortion", true, 22)]
|
||||
/// the duration of the shake in seconds
|
||||
[Tooltip("the duration of the shake in seconds")]
|
||||
public float Duration = 0.8f;
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 23)]
|
||||
/// 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(-1f, 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(-1f, 1f)]
|
||||
public float RemapIntensityOne = 0.5f;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a lens distortion shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMLensDistortionShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne,
|
||||
RelativeIntensity, channelData:ChannelData, stop: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMLensDistortionShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne,
|
||||
RelativeIntensity, channelData:ChannelData, restore: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<LensDistortion, MMLensDistortionShaker_HDRP>(Owner, "LensDistortion");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_LensDistortion_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_LensDistortion_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 238ecd560015b8747bc952b63dc334c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
121
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_MotionBlur_HDRP.cs
vendored
Normal file
121
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_MotionBlur_HDRP.cs
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP motion blur intensity over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with MotionBlur active, and a MMMotionBlurShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Motion Blur HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control motion blur intensity over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with MotionBlur active, and a MMMotionBlurShaker_HDRP component.")]
|
||||
public class MMF_MotionBlur_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Motion Blur", true, 24)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 25)]
|
||||
/// 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 which to remap the curve's zero to
|
||||
[Tooltip("the value to which to remap the curve's zero to")]
|
||||
public float RemapIntensityZero = 0f;
|
||||
/// the value to which to remap the curve's one to
|
||||
[Tooltip("the value to which to remap the curve's one to")]
|
||||
public float RemapIntensityOne = 1000f;
|
||||
/// whether or not to add to the initial intensity
|
||||
[Tooltip("whether or not to add to the initial intensity")]
|
||||
public bool RelativeIntensity = false;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a motion blur shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMMotionBlurShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
MMMotionBlurShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne,
|
||||
RelativeIntensity, channelData:ChannelData, stop: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMMotionBlurShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne,
|
||||
RelativeIntensity, channelData:ChannelData, restore: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<MotionBlur, MMMotionBlurShaker_HDRP>(Owner, "MotionBlur");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_MotionBlur_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_MotionBlur_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bc2946b57a0e7f40a9cb297b9f96923
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
119
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_PaniniProjection_HDRP.cs
vendored
Normal file
119
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_PaniniProjection_HDRP.cs
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control Panini Projection distance and crop to fit over time.
|
||||
/// It requires you have in your scene an object with a Volume with Bloom active, and a MMPaniniProjectionShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[FeedbackHelp("This feedback allows you to control Panini Projection distance and crop to fit over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with PaniniProjection active, and a MMPaniniProjectionShaker_HDRP component.")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Panini Projection HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
public class MMF_PaniniProjection_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Panini Projection", true, 26)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Distance", true, 27)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeDistance = false;
|
||||
/// the curve used to animate the distance value on
|
||||
[Tooltip("the curve used to animate the distance value on")]
|
||||
public AnimationCurve ShakeDistance = 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, 1f)]
|
||||
public float RemapDistanceZero = 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 RemapDistanceOne = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a bloom shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMPaniniProjectionShakeEvent_HDRP.Trigger(ShakeDistance, FeedbackDuration, RemapDistanceZero, RemapDistanceOne, RelativeDistance, intensityMultiplier, ChannelData,
|
||||
ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
MMPaniniProjectionShakeEvent_HDRP.Trigger(ShakeDistance, FeedbackDuration, RemapDistanceZero, RemapDistanceOne, RelativeDistance, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMPaniniProjectionShakeEvent_HDRP.Trigger(ShakeDistance, FeedbackDuration, RemapDistanceZero, RemapDistanceOne, RelativeDistance, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<PaniniProjection, MMPaniniProjectionShaker_HDRP>(Owner, "PaniniProjection");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37877494ec9bebd499aa2b7ee97f204e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
140
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Vignette_HDRP.cs
vendored
Normal file
140
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Vignette_HDRP.cs
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control HDRP vignette intensity over time.
|
||||
/// It requires you have in your scene an object with a Volume
|
||||
/// with Vignette active, and a MMVignetteShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/Vignette HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
[FeedbackHelp("This feedback allows you to control vignette intensity over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with Vignette active, and a MMVignetteShaker_HDRP component.")]
|
||||
public class MMF_Vignette_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(Duration); } set { Duration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("Vignette", true, 28)]
|
||||
/// 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;
|
||||
|
||||
[MMFInspectorGroup("Intensity", true, 29)]
|
||||
/// 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 curve's zero to
|
||||
[Tooltip("the value to remap the curve's zero to")]
|
||||
[Range(0f, 1f)]
|
||||
public float RemapIntensityZero = 0f;
|
||||
/// the value to remap the curve's one to
|
||||
[Tooltip("the value to remap the curve'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;
|
||||
|
||||
[Header("Color")]
|
||||
/// whether or not to also animate the vignette's color
|
||||
[Tooltip("whether or not to also animate the vignette's color")]
|
||||
public bool InterpolateColor = false;
|
||||
/// the curve to animate the color on
|
||||
[Tooltip("the curve to animate the color on")]
|
||||
public AnimationCurve ColorCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.05f, 1f), new Keyframe(0.95f, 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, 1)]
|
||||
public float RemapColorZero = 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 RemapColorOne = 1f;
|
||||
/// the color to lerp towards
|
||||
[Tooltip("the color to lerp towards")]
|
||||
public Color TargetColor = Color.red;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a vignette shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMVignetteShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode, false, false, InterpolateColor,
|
||||
ColorCurve, RemapColorZero, RemapColorOne, TargetColor);
|
||||
}
|
||||
|
||||
/// <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_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMVignetteShakeEvent_HDRP.Trigger(Intensity, FeedbackDuration, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<Vignette, MMVignetteShaker_HDRP>(Owner, "Vignette");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Vignette_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_Vignette_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 294ea96cd093b544b8428037f5a17b43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
135
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_WhiteBalance_HDRP.cs
vendored
Normal file
135
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_WhiteBalance_HDRP.cs
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Scripting.APIUpdating;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// This feedback allows you to control white balance temperature and tint over time.
|
||||
/// It requires you have in your scene an object with a Volume with White Balance active, and a MMWhiteBalanceShaker_HDRP component.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[FeedbackHelp("This feedback allows you to control white balance temperature and tint over time. " +
|
||||
"It requires you have in your scene an object with a Volume " +
|
||||
"with WhiteBalance active, and a MMWhiteBalanceShaker_HDRP component.")]
|
||||
#if MM_HDRP
|
||||
[FeedbackPath("PostProcess/White Balance HDRP")]
|
||||
#endif
|
||||
[MovedFrom(false, null, "MoreMountains.Feedbacks.HDRP")]
|
||||
public class MMF_WhiteBalance_HDRP : MMF_Feedback
|
||||
{
|
||||
/// 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; } }
|
||||
public override bool HasCustomInspectors => true;
|
||||
public override bool HasAutomaticShakerSetup => true;
|
||||
#endif
|
||||
|
||||
/// the duration of this feedback is the duration of the shake
|
||||
public override float FeedbackDuration { get { return ApplyTimeMultiplier(ShakeDuration); } set { ShakeDuration = value; } }
|
||||
public override bool HasChannel => true;
|
||||
public override bool HasRandomness => true;
|
||||
|
||||
[MMFInspectorGroup("White Balance", true, 32)]
|
||||
/// 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 value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
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;
|
||||
|
||||
[MMFInspectorGroup("Temperature", true, 33)]
|
||||
/// the curve used to animate the temperature value on
|
||||
[Tooltip("the curve used to animate the temperature value on")]
|
||||
public AnimationCurve ShakeTemperature = 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 RemapTemperatureZero = 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 RemapTemperatureOne = 100f;
|
||||
|
||||
[MMFInspectorGroup("Tint", true, 34)]
|
||||
/// the curve used to animate the tint value on
|
||||
[Tooltip("the curve used to animate the tint value on")]
|
||||
public AnimationCurve ShakeTint = 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 RemapTintZero = 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 RemapTintOne = 100f;
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a white balance shake
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float intensityMultiplier = ComputeIntensity(feedbacksIntensity, position);
|
||||
MMWhiteBalanceShakeEvent_HDRP.Trigger(ShakeTemperature, FeedbackDuration, RemapTemperatureZero, RemapTemperatureOne,
|
||||
ShakeTint, RemapTintZero, RemapTintOne, RelativeValues, intensityMultiplier,
|
||||
ChannelData, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection, ComputedTimescaleMode);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
MMWhiteBalanceShakeEvent_HDRP.Trigger(ShakeTemperature, FeedbackDuration, RemapTemperatureZero, RemapTemperatureOne,
|
||||
ShakeTint, RemapTintZero, RemapTintOne, RelativeValues, channelData:ChannelData, stop:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On restore, we put our object back at its initial position
|
||||
/// </summary>
|
||||
protected override void CustomRestoreInitialValues()
|
||||
{
|
||||
if (!Active || !FeedbackTypeAuthorized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MMWhiteBalanceShakeEvent_HDRP.Trigger(ShakeTemperature, FeedbackDuration, RemapTemperatureZero, RemapTemperatureOne,
|
||||
ShakeTint, RemapTintZero, RemapTintOne, RelativeValues, channelData:ChannelData, restore:true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automaticall sets up the post processing profile and shaker
|
||||
/// </summary>
|
||||
public override void AutomaticShakerSetup()
|
||||
{
|
||||
#if MM_HDRP && UNITY_EDITOR
|
||||
MMHDRPHelpers.GetOrCreateVolume<WhiteBalance, MMWhiteBalanceShaker_HDRP>(Owner, "WhiteBalance");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_WhiteBalance_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks/MMF_WhiteBalance_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c85a8307aa986a14d83db219ddc633da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user