chore: initial commit
This commit is contained in:
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks.meta
vendored
Normal file
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Feedbacks.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7dab5186b8781443af2d704b2a93808
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
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:
|
||||
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers.meta
vendored
Normal file
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb24ea5872be22e4398def836ab33158
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
64
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers/MMHDRPHelpers.cs
vendored
Normal file
64
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers/MMHDRPHelpers.cs
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
using UnityEngine;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
public class MMHDRPHelpers : MonoBehaviour
|
||||
{
|
||||
#if UNITY_EDITOR && MM_HDRP
|
||||
public static void GetOrCreateVolume<T, U>(MMF_Player owner, string feedbackName) where T:VolumeComponent where U:MMShaker
|
||||
{
|
||||
string additions = owner.name + " "+feedbackName+" feedback automatic shaker setup : ";
|
||||
|
||||
// looks for the main camera
|
||||
/*HDAdditionalCameraData cameraData = Camera.main.get();
|
||||
cameraData.renderPostProcessing = true;
|
||||
additions += "Set PostProcessing:true on the "+Camera.main.name+" camera. ";*/
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("Automatic shaker setup is only available outside of play mode.");
|
||||
return;
|
||||
}
|
||||
|
||||
// looks for a Volume
|
||||
Volume volume = (Volume)Object.FindObjectOfType(typeof(Volume));
|
||||
if (volume == null)
|
||||
{
|
||||
GameObject postProcessingObject = GameObject.Instantiate(Resources.Load<GameObject>("MMDefaultHDRPVolume"));
|
||||
volume = postProcessingObject.GetComponent<Volume>();
|
||||
additions += "Added a Volume to the scene. ";
|
||||
}
|
||||
|
||||
// looks for a setting on the volume
|
||||
T effect;
|
||||
if (!volume.sharedProfile.TryGet(out effect))
|
||||
{
|
||||
effect = volume.sharedProfile.Add<T>();
|
||||
AssetDatabase.AddObjectToAsset(effect, volume.sharedProfile);
|
||||
EditorUtility.SetDirty(volume.sharedProfile);
|
||||
AssetDatabase.SaveAssets();
|
||||
additions += "Added a "+feedbackName+" post process effect to the "+volume.gameObject.name+" Volume. ";
|
||||
}
|
||||
|
||||
// looks for a matching shaker
|
||||
U shaker = volume.GetComponent<U>();
|
||||
if (shaker == null)
|
||||
{
|
||||
shaker = volume.gameObject.AddComponent<U>();
|
||||
additions += "Added a "+feedbackName+" Shaker to the "+volume.gameObject.name+" Post Process Volume. ";
|
||||
}
|
||||
|
||||
MMDebug.DebugLogInfo( additions + "You're all set.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers/MMHDRPHelpers.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Helpers/MMHDRPHelpers.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d40819da14d2d1499237afb52ba159b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
3
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/MoreMountains.Feedbacks.HDRP.asmref
vendored
Normal file
3
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/MoreMountains.Feedbacks.HDRP.asmref
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"reference": "GUID:4a1cb1490dc4df8409b2580d6b44e75e"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7a2bc31348bf0944bdfecbcd88c4c5f
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources.meta
vendored
Normal file
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9a571ec0a051de4cad61decc0778d60
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
555
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources/MMDefaultHDRPProfile.asset
vendored
Normal file
555
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources/MMDefaultHDRPProfile.asset
vendored
Normal file
@@ -0,0 +1,555 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-6864796670186077981
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2d08ce26990eb1a4a9177b860541e702, type: 3}
|
||||
m_Name: Exposure
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
mode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
meteringMode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 2
|
||||
luminanceSource:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
fixedExposure:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
compensation:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
limitMin:
|
||||
m_OverrideState: 0
|
||||
m_Value: -1
|
||||
limitMax:
|
||||
m_OverrideState: 0
|
||||
m_Value: 14
|
||||
curveMap:
|
||||
m_OverrideState: 0
|
||||
m_Value:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: -10
|
||||
value: -10
|
||||
inSlope: 0
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 20
|
||||
value: 20
|
||||
inSlope: 1
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
limitMinCurveMap:
|
||||
m_OverrideState: 0
|
||||
m_Value:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: -10
|
||||
value: -12
|
||||
inSlope: 0
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 20
|
||||
value: 18
|
||||
inSlope: 1
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
limitMaxCurveMap:
|
||||
m_OverrideState: 0
|
||||
m_Value:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: -10
|
||||
value: -8
|
||||
inSlope: 0
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 20
|
||||
value: 22
|
||||
inSlope: 1
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
adaptationMode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
adaptationSpeedDarkToLight:
|
||||
m_OverrideState: 0
|
||||
m_Value: 3
|
||||
adaptationSpeedLightToDark:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
weightTextureMask:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
histogramPercentages:
|
||||
m_OverrideState: 0
|
||||
m_Value: {x: 40, y: 90}
|
||||
histogramUseCurveRemapping:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
targetMidGray:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
centerAroundExposureTarget:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
proceduralCenter:
|
||||
m_OverrideState: 0
|
||||
m_Value: {x: 0.5, y: 0.5}
|
||||
proceduralRadii:
|
||||
m_OverrideState: 0
|
||||
m_Value: {x: 0.3, y: 0.3}
|
||||
maskMinIntensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: -30
|
||||
maskMaxIntensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 30
|
||||
proceduralSoftness:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.5
|
||||
--- !u!114 &-4721986238830533519
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 598e2d32e2c7b0c418e030c3236d663a, type: 3}
|
||||
m_Name: ChromaticAberration
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
quality:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
spectralLut:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
m_MaxSamples:
|
||||
m_OverrideState: 0
|
||||
m_Value: 6
|
||||
--- !u!114 &-3418317779778852996
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4b709909182ba0943abef2c49ed59205, type: 3}
|
||||
m_Name: PaniniProjection
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
distance:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
cropToFit:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
--- !u!114 &-3100227611986916207
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5a6b00fcf518bb94a90b408492e07b44, type: 3}
|
||||
m_Name: FilmGrain
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
type:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
response:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.8
|
||||
texture:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
|
||||
m_Name: MMDefaultHDRPProfile
|
||||
m_EditorClassIdentifier:
|
||||
components:
|
||||
- {fileID: 3130278352603341482}
|
||||
- {fileID: 8114150874529261208}
|
||||
- {fileID: -4721986238830533519}
|
||||
- {fileID: 4364790808715750781}
|
||||
- {fileID: 1206188211813505803}
|
||||
- {fileID: -6864796670186077981}
|
||||
- {fileID: -3100227611986916207}
|
||||
- {fileID: 2749208635296186750}
|
||||
- {fileID: 2419058983776598554}
|
||||
- {fileID: -3418317779778852996}
|
||||
- {fileID: 5180638621136054042}
|
||||
- {fileID: 7041725288631384964}
|
||||
--- !u!114 &1206188211813505803
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: aaa3b8214f75b354e9ba2caadd022259, type: 3}
|
||||
m_Name: DepthOfField
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
quality:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
focusMode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
focusDistance:
|
||||
m_OverrideState: 0
|
||||
m_Value: 10
|
||||
focusDistanceMode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
nearFocusStart:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
nearFocusEnd:
|
||||
m_OverrideState: 0
|
||||
m_Value: 4
|
||||
farFocusStart:
|
||||
m_OverrideState: 0
|
||||
m_Value: 10
|
||||
farFocusEnd:
|
||||
m_OverrideState: 0
|
||||
m_Value: 20
|
||||
m_NearSampleCount:
|
||||
m_OverrideState: 0
|
||||
m_Value: 5
|
||||
m_NearMaxBlur:
|
||||
m_OverrideState: 0
|
||||
m_Value: 4
|
||||
m_FarSampleCount:
|
||||
m_OverrideState: 0
|
||||
m_Value: 7
|
||||
m_FarMaxBlur:
|
||||
m_OverrideState: 0
|
||||
m_Value: 8
|
||||
m_Resolution:
|
||||
m_OverrideState: 0
|
||||
m_Value: 2
|
||||
m_HighQualityFiltering:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
m_PhysicallyBased:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
m_LimitManualRangeNearBlur:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
--- !u!114 &2419058983776598554
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bcf384b154398e341b6b29969c078198, type: 3}
|
||||
m_Name: MotionBlur
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
quality:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
maximumVelocity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 200
|
||||
minimumVelocity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 2
|
||||
cameraMotionBlur:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
specialCameraClampMode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
cameraVelocityClamp:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.05
|
||||
cameraTranslationVelocityClamp:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.05
|
||||
cameraRotationVelocityClamp:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.03
|
||||
depthComparisonExtent:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
m_SampleCount:
|
||||
m_OverrideState: 0
|
||||
m_Value: 8
|
||||
--- !u!114 &2749208635296186750
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9c1bfcd0f0fa7b8468f281d6bbbaf320, type: 3}
|
||||
m_Name: LensDistortion
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
xMultiplier:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
yMultiplier:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
center:
|
||||
m_OverrideState: 0
|
||||
m_Value: {x: 0.5, y: 0.5}
|
||||
scale:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
--- !u!114 &3130278352603341482
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 24f077503be6ae942a1e1245dbd53ea9, type: 3}
|
||||
m_Name: Bloom
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
quality:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
threshold:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
scatter:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.7
|
||||
tint:
|
||||
m_OverrideState: 0
|
||||
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||
dirtTexture:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
dirtIntensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
anamorphic:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
m_Resolution:
|
||||
m_OverrideState: 0
|
||||
m_Value: 2
|
||||
m_HighQualityPrefiltering:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
m_HighQualityFiltering:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
--- !u!114 &4364790808715750781
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4b8bcdf71d7fafa419fca1ed162f5fc9, type: 3}
|
||||
m_Name: ColorAdjustments
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
postExposure:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
contrast:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
colorFilter:
|
||||
m_OverrideState: 0
|
||||
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||
hueShift:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
saturation:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
--- !u!114 &5180638621136054042
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2c1be1b6c95cd2e41b27903b9270817f, type: 3}
|
||||
m_Name: Vignette
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
mode:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
color:
|
||||
m_OverrideState: 0
|
||||
m_Value: {r: 0, g: 0, b: 0, a: 1}
|
||||
center:
|
||||
m_OverrideState: 0
|
||||
m_Value: {x: 0.5, y: 0.5}
|
||||
intensity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
smoothness:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0.2
|
||||
roundness:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
rounded:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
mask:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
opacity:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
--- !u!114 &7041725288631384964
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b51a78e223a2e504bb88a059b55229ea, type: 3}
|
||||
m_Name: WhiteBalance
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
temperature:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
tint:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
--- !u!114 &8114150874529261208
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a7649d9368d3a5c4ab8ad01a63e04962, type: 3}
|
||||
m_Name: ChannelMixer
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
redOutRedIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 100
|
||||
redOutGreenIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
redOutBlueIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
greenOutRedIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
greenOutGreenIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 100
|
||||
greenOutBlueIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
blueOutRedIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
blueOutGreenIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 0
|
||||
blueOutBlueIn:
|
||||
m_OverrideState: 0
|
||||
m_Value: 100
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6c55732adbfa0d4593bd219357d1a00
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources/MMDefaultHDRPVolume.prefab
vendored
Normal file
51
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Resources/MMDefaultHDRPVolume.prefab
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4977394314651325502
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9096337897072025802}
|
||||
- component: {fileID: 2928670984742858032}
|
||||
m_Layer: 0
|
||||
m_Name: MMDefaultHDRPVolume
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9096337897072025802
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4977394314651325502}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2928670984742858032
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4977394314651325502}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IsGlobal: 1
|
||||
priority: 0
|
||||
blendDistance: 0
|
||||
weight: 1
|
||||
sharedProfile: {fileID: 11400000, guid: d6c55732adbfa0d4593bd219357d1a00, type: 2}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 041a480513ea4f947a590bb1195e91a0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers.meta
vendored
Normal file
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c66cd8a28b9b11e40b7e222449c416cf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
225
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMBloomShaker_HDRP.cs
vendored
Normal file
225
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMBloomShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,225 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
using UnityEngine.Rendering;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP bloom post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMBloomShaker_HDRP")]
|
||||
public class MMBloomShaker_HDRP : MMShaker
|
||||
{
|
||||
/// whether or not to add to the initial value
|
||||
public bool RelativeValues = true;
|
||||
|
||||
[MMInspectorGroup("Bloom Intensity", true, 42)]
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value 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;
|
||||
|
||||
[MMInspectorGroup("Bloom Threshold", true, 43)]
|
||||
/// the curve used to animate the threshold value on
|
||||
[Tooltip("the curve used to animate the threshold value 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected Bloom _bloom;
|
||||
protected float _initialIntensity;
|
||||
protected float _initialThreshold;
|
||||
protected float _originalShakeDuration;
|
||||
protected bool _originalRelativeIntensity;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected AnimationCurve _originalShakeThreshold;
|
||||
protected float _originalRemapThresholdZero;
|
||||
protected float _originalRemapThresholdOne;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _bloom);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newIntensity = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeValues, _initialIntensity);
|
||||
_bloom.intensity.Override(newIntensity);
|
||||
float newThreshold = ShakeFloat(ShakeThreshold, RemapThresholdZero, RemapThresholdOne, RelativeValues, _initialThreshold);
|
||||
_bloom.threshold.Override(newThreshold);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _bloom.intensity.value;
|
||||
_initialThreshold = _bloom.threshold.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnBloomShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax,
|
||||
AnimationCurve threshold, float remapThresholdMin, float remapThresholdMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true,
|
||||
bool resetTargetValuesAfterShake = true, bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled,
|
||||
bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeValues;
|
||||
_originalShakeThreshold = ShakeThreshold;
|
||||
_originalRemapThresholdZero = RemapThresholdZero;
|
||||
_originalRemapThresholdOne = RemapThresholdOne;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeValues = relativeIntensity;
|
||||
ShakeThreshold = threshold;
|
||||
RemapThresholdZero = remapThresholdMin;
|
||||
RemapThresholdOne = remapThresholdMax;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_bloom.intensity.Override(_initialIntensity);
|
||||
_bloom.threshold.Override(_initialThreshold);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeValues = _originalRelativeIntensity;
|
||||
ShakeThreshold = _originalShakeThreshold;
|
||||
RemapThresholdZero = _originalRemapThresholdZero;
|
||||
RemapThresholdOne = _originalRemapThresholdOne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMBloomShakeEvent_HDRP.Register(OnBloomShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMBloomShakeEvent_HDRP.Unregister(OnBloomShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMBloomShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax,
|
||||
AnimationCurve threshold, float remapThresholdMin, float remapThresholdMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true,
|
||||
bool resetTargetValuesAfterShake = true, bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled,
|
||||
bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax,
|
||||
AnimationCurve threshold, float remapThresholdMin, float remapThresholdMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true,
|
||||
bool resetTargetValuesAfterShake = true, bool forwardDirection = true,
|
||||
TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, threshold, remapThresholdMin, remapThresholdMax, relativeIntensity,
|
||||
attenuation, channelData, resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMBloomShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMBloomShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09ed30f22b4748a44bc7862a66f01f2e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
277
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChannelMixerShaker_HDRP.cs
vendored
Normal file
277
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChannelMixerShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,277 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP color adjustments post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMChannelMixerShaker_HDRP")]
|
||||
public class MMChannelMixerShaker_HDRP : MMShaker
|
||||
{
|
||||
/// whether or not to add to the initial value
|
||||
public bool RelativeValues = true;
|
||||
|
||||
[MMInspectorGroup("Red", true, 42)]
|
||||
/// 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;
|
||||
|
||||
[MMInspectorGroup("Green", true, 43)]
|
||||
/// 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;
|
||||
|
||||
[MMInspectorGroup("Blue", true, 44)]
|
||||
/// 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected ChannelMixer _channelMixer;
|
||||
protected float _initialRed;
|
||||
protected float _initialGreen;
|
||||
protected float _initialBlue;
|
||||
protected float _initialContrast;
|
||||
protected Color _initialColorFilterColor;
|
||||
protected float _originalShakeDuration;
|
||||
protected bool _originalRelativeValues;
|
||||
|
||||
protected AnimationCurve _originalShakeRed;
|
||||
protected float _originalRemapRedZero;
|
||||
protected float _originalRemapRedOne;
|
||||
protected AnimationCurve _originalShakeGreen;
|
||||
protected float _originalRemapGreenZero;
|
||||
protected float _originalRemapGreenOne;
|
||||
protected AnimationCurve _originalShakeBlue;
|
||||
protected float _originalRemapBlueZero;
|
||||
protected float _originalRemapBlueOne;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _channelMixer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When that shaker gets added, we initialize its shake duration
|
||||
/// </summary>
|
||||
protected virtual void Reset()
|
||||
{
|
||||
ShakeDuration = 0.8f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newRed = ShakeFloat(ShakeRed, RemapRedZero, RemapRedOne, RelativeValues, _initialRed);
|
||||
_channelMixer.redOutRedIn.Override(newRed);
|
||||
float newGreen = ShakeFloat(ShakeGreen, RemapGreenZero, RemapGreenOne, RelativeValues, _initialGreen);
|
||||
_channelMixer.greenOutGreenIn.Override(newGreen);
|
||||
float newBlue = ShakeFloat(ShakeBlue, RemapBlueZero, RemapBlueOne, RelativeValues, _initialBlue);
|
||||
_channelMixer.blueOutBlueIn.Override(newBlue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialRed = _channelMixer.redOutRedIn.value;
|
||||
_initialGreen = _channelMixer.greenOutGreenIn.value;
|
||||
_initialBlue = _channelMixer.blueOutBlueIn.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnMMChannelMixerShakeEvent(AnimationCurve shakeRed, float remapRedZero, float remapRedOne,
|
||||
AnimationCurve shakeGreen, float remapGreenZero, float remapGreenOne,
|
||||
AnimationCurve shakeBlue, float remapBlueZero, float remapBlueOne,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalRelativeValues = RelativeValues;
|
||||
_originalShakeRed = ShakeRed;
|
||||
_originalRemapRedZero = RemapRedZero;
|
||||
_originalRemapRedOne = RemapRedOne;
|
||||
_originalShakeGreen = ShakeGreen;
|
||||
_originalRemapGreenZero = RemapGreenZero;
|
||||
_originalRemapGreenOne = RemapGreenOne;
|
||||
_originalShakeBlue = ShakeBlue;
|
||||
_originalRemapBlueZero = RemapBlueZero;
|
||||
_originalRemapBlueOne = RemapBlueOne;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
RelativeValues = relativeValues;
|
||||
ShakeRed = shakeRed;
|
||||
RemapRedZero = remapRedZero;
|
||||
RemapRedOne = remapRedOne;
|
||||
ShakeGreen = shakeGreen;
|
||||
RemapGreenZero = remapGreenZero;
|
||||
RemapGreenOne = remapGreenOne;
|
||||
ShakeBlue = shakeBlue;
|
||||
RemapBlueZero = remapBlueZero;
|
||||
RemapBlueOne = remapBlueOne;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_channelMixer.redOutRedIn.Override(_initialRed);
|
||||
_channelMixer.greenOutGreenIn.Override(_initialGreen);
|
||||
_channelMixer.blueOutBlueIn.Override(_initialBlue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
RelativeValues = _originalRelativeValues;
|
||||
ShakeRed = _originalShakeRed;
|
||||
RemapRedZero = _originalRemapRedZero;
|
||||
RemapRedOne = _originalRemapRedOne;
|
||||
ShakeGreen = _originalShakeGreen;
|
||||
RemapGreenZero = _originalRemapGreenZero;
|
||||
RemapGreenOne = _originalRemapGreenOne;
|
||||
ShakeBlue = _originalShakeBlue;
|
||||
RemapBlueZero = _originalRemapBlueZero;
|
||||
RemapBlueOne = _originalRemapBlueOne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMChannelMixerShakeEvent_HDRP.Register(OnMMChannelMixerShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMChannelMixerShakeEvent_HDRP.Unregister(OnMMChannelMixerShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMChannelMixerShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(
|
||||
AnimationCurve shakeRed, float remapRedZero, float remapRedOne,
|
||||
AnimationCurve shakeGreen, float remapGreenZero, float remapGreenOne,
|
||||
AnimationCurve shakeBlue, float remapBlueZero, float remapBlueOne,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(
|
||||
AnimationCurve shakeRed, float remapRedZero, float remapRedOne,
|
||||
AnimationCurve shakeGreen, float remapGreenZero, float remapGreenOne,
|
||||
AnimationCurve shakeBlue, float remapBlueZero, float remapBlueOne,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(shakeRed, remapRedZero, remapRedOne,
|
||||
shakeGreen, remapGreenZero, remapGreenOne,
|
||||
shakeBlue, remapBlueZero, remapBlueOne,
|
||||
duration, relativeValues, attenuation, channelData, resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChannelMixerShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChannelMixerShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33e96efc928fc8848b7698b3703f9f02
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
193
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChromaticAberrationShaker_HDRP.cs
vendored
Normal file
193
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMChromaticAberrationShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP chromatic aberration post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMChromaticAberrationShaker_HDRP")]
|
||||
public class MMChromaticAberrationShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Chromatic Aberration Intensity", true, 44)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value 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")]
|
||||
[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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected ChromaticAberration _chromaticAberration;
|
||||
protected float _initialIntensity;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected bool _originalRelativeIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _chromaticAberration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, _initialIntensity);
|
||||
_chromaticAberration.intensity.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _chromaticAberration.intensity.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnMMChromaticAberrationShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeIntensity;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_chromaticAberration.intensity.Override(_initialIntensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeIntensity = _originalRelativeIntensity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMChromaticAberrationShakeEvent_HDRP.Register(OnMMChromaticAberrationShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMChromaticAberrationShakeEvent_HDRP.Unregister(OnMMChromaticAberrationShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMChromaticAberrationShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, relativeIntensity, attenuation, channelData, resetShakerValuesAfterShake,
|
||||
resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0f7ebe879e82aa489329e54525c43ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
359
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMColorAdjustmentsShaker_HDRP.cs
vendored
Normal file
359
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMColorAdjustmentsShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,359 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Tools;
|
||||
using MoreMountains.Feedbacks;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP color adjustments post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMColorAdjustmentsShaker_HDRP")]
|
||||
public class MMColorAdjustmentsShaker_HDRP : MMShaker
|
||||
{
|
||||
/// whether or not to add to the initial value
|
||||
public bool RelativeValues = true;
|
||||
|
||||
[MMInspectorGroup("Post Exposure", true, 44)]
|
||||
/// 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;
|
||||
|
||||
[MMInspectorGroup("Hue Shift", true, 45)]
|
||||
/// 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
|
||||
[Range(-180f, 180f)]
|
||||
[Tooltip("the value to remap the curve's 0 to")]
|
||||
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;
|
||||
|
||||
[MMInspectorGroup("Saturation", true, 46)]
|
||||
/// 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;
|
||||
|
||||
[MMInspectorGroup("Contrast", true, 47)]
|
||||
/// 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;
|
||||
|
||||
public enum ColorFilterModes { None, Gradient, Interpolate }
|
||||
|
||||
[MMInspectorGroup("Color Filter", true, 48)]
|
||||
/// the color filter mode to work with (none, over a gradient, or interpolate to a destination color
|
||||
[Tooltip("the color filter mode to work with (none, over a gradient, or interpolate to a destination color")]
|
||||
public ColorFilterModes ColorFilterMode = ColorFilterModes.None;
|
||||
/// the gradient over which to modify the color filter
|
||||
[Tooltip("the gradient over which to modify the color filter")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int)ColorFilterModes.Gradient)]
|
||||
[GradientUsage(true)]
|
||||
public Gradient ColorFilterGradient;
|
||||
/// the destination color to match when in Interpolate mode
|
||||
[Tooltip("the destination color to match when in Interpolate mode")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int) ColorFilterModes.Interpolate)]
|
||||
public Color ColorFilterDestination = Color.yellow;
|
||||
/// the curve over which to interpolate the color filter
|
||||
[Tooltip("the curve over which to interpolate the color filter")]
|
||||
[MMFEnumCondition("ColorFilterMode", (int) ColorFilterModes.Interpolate)]
|
||||
public AnimationCurve ColorFilterCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0));
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected ColorAdjustments _colorAdjustments;
|
||||
protected float _initialPostExposure;
|
||||
protected float _initialHueShift;
|
||||
protected float _initialSaturation;
|
||||
protected float _initialContrast;
|
||||
protected Color _initialColorFilterColor;
|
||||
protected float _originalShakeDuration;
|
||||
protected bool _originalRelativeValues;
|
||||
protected AnimationCurve _originalShakePostExposure;
|
||||
protected float _originalRemapPostExposureZero;
|
||||
protected float _originalRemapPostExposureOne;
|
||||
protected AnimationCurve _originalShakeHueShift;
|
||||
protected float _originalRemapHueShiftZero;
|
||||
protected float _originalRemapHueShiftOne;
|
||||
protected AnimationCurve _originalShakeSaturation;
|
||||
protected float _originalRemapSaturationZero;
|
||||
protected float _originalRemapSaturationOne;
|
||||
protected AnimationCurve _originalShakeContrast;
|
||||
protected float _originalRemapContrastZero;
|
||||
protected float _originalRemapContrastOne;
|
||||
protected ColorFilterModes _originalColorFilterMode;
|
||||
protected Gradient _originalColorFilterGradient;
|
||||
protected Color _originalColorFilterDestination;
|
||||
protected AnimationCurve _originalColorFilterCurve;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _colorAdjustments);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When that shaker gets added, we initialize its shake duration
|
||||
/// </summary>
|
||||
protected virtual void Reset()
|
||||
{
|
||||
ShakeDuration = 0.8f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newPostExposure = ShakeFloat(ShakePostExposure, RemapPostExposureZero, RemapPostExposureOne, RelativeValues, _initialPostExposure);
|
||||
_colorAdjustments.postExposure.Override(newPostExposure);
|
||||
float newHueShift = ShakeFloat(ShakeHueShift, RemapHueShiftZero, RemapHueShiftOne, RelativeValues, _initialHueShift);
|
||||
_colorAdjustments.hueShift.Override(newHueShift);
|
||||
float newSaturation = ShakeFloat(ShakeSaturation, RemapSaturationZero, RemapSaturationOne, RelativeValues, _initialSaturation);
|
||||
_colorAdjustments.saturation.Override(newSaturation);
|
||||
float newContrast = ShakeFloat(ShakeContrast, RemapContrastZero, RemapContrastOne, RelativeValues, _initialContrast);
|
||||
_colorAdjustments.contrast.Override(newContrast);
|
||||
|
||||
_remappedTimeSinceStart = MMFeedbacksHelpers.Remap(Time.time - _shakeStartedTimestamp, 0f, ShakeDuration, 0f, 1f);
|
||||
|
||||
if (ColorFilterMode == ColorFilterModes.Gradient)
|
||||
{
|
||||
_colorAdjustments.colorFilter.Override(ColorFilterGradient.Evaluate(_remappedTimeSinceStart));
|
||||
}
|
||||
else if (ColorFilterMode == ColorFilterModes.Interpolate)
|
||||
{
|
||||
float factor = ColorFilterCurve.Evaluate(_remappedTimeSinceStart);
|
||||
_colorAdjustments.colorFilter.Override(Color.LerpUnclamped(_initialColorFilterColor, ColorFilterDestination, factor));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialPostExposure = _colorAdjustments.postExposure.value;
|
||||
_initialHueShift = _colorAdjustments.hueShift.value;
|
||||
_initialSaturation = _colorAdjustments.saturation.value;
|
||||
_initialContrast = _colorAdjustments.contrast.value;
|
||||
_initialColorFilterColor = _colorAdjustments.colorFilter.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnMMColorGradingShakeEvent(AnimationCurve shakePostExposure, float remapPostExposureZero, float remapPostExposureOne,
|
||||
AnimationCurve shakeHueShift, float remapHueShiftZero, float remapHueShiftOne,
|
||||
AnimationCurve shakeSaturation, float remapSaturationZero, float remapSaturationOne,
|
||||
AnimationCurve shakeContrast, float remapContrastZero, float remapContrastOne,
|
||||
ColorFilterModes colorFilterMode, Gradient colorFilterGradient, Color colorFilterDestination,AnimationCurve colorFilterCurve,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalRelativeValues = RelativeValues;
|
||||
_originalShakePostExposure = ShakePostExposure;
|
||||
_originalRemapPostExposureZero = RemapPostExposureZero;
|
||||
_originalRemapPostExposureOne = RemapPostExposureOne;
|
||||
_originalShakeHueShift = ShakeHueShift;
|
||||
_originalRemapHueShiftZero = RemapHueShiftZero;
|
||||
_originalRemapHueShiftOne = RemapHueShiftOne;
|
||||
_originalShakeSaturation = ShakeSaturation;
|
||||
_originalRemapSaturationZero = RemapSaturationZero;
|
||||
_originalRemapSaturationOne = RemapSaturationOne;
|
||||
_originalShakeContrast = ShakeContrast;
|
||||
_originalRemapContrastZero = RemapContrastZero;
|
||||
_originalRemapContrastOne = RemapContrastOne;
|
||||
_originalColorFilterMode = ColorFilterMode;
|
||||
_originalColorFilterGradient = ColorFilterGradient;
|
||||
_originalColorFilterDestination = ColorFilterDestination;
|
||||
_originalColorFilterCurve = ColorFilterCurve;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
RelativeValues = relativeValues;
|
||||
ShakePostExposure = shakePostExposure;
|
||||
RemapPostExposureZero = remapPostExposureZero;
|
||||
RemapPostExposureOne = remapPostExposureOne;
|
||||
ShakeHueShift = shakeHueShift;
|
||||
RemapHueShiftZero = remapHueShiftZero;
|
||||
RemapHueShiftOne = remapHueShiftOne;
|
||||
ShakeSaturation = shakeSaturation;
|
||||
RemapSaturationZero = remapSaturationZero;
|
||||
RemapSaturationOne = remapSaturationOne;
|
||||
ShakeContrast = shakeContrast;
|
||||
RemapContrastZero = remapContrastZero;
|
||||
RemapContrastOne = remapContrastOne;
|
||||
ColorFilterMode = colorFilterMode;
|
||||
ColorFilterGradient = colorFilterGradient;
|
||||
ColorFilterDestination = colorFilterDestination;
|
||||
ColorFilterCurve = colorFilterCurve;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_colorAdjustments.postExposure.Override(_initialPostExposure);
|
||||
_colorAdjustments.hueShift.Override(_initialHueShift);
|
||||
_colorAdjustments.saturation.Override(_initialSaturation);
|
||||
_colorAdjustments.contrast.Override(_initialContrast);
|
||||
_colorAdjustments.colorFilter.Override(_initialColorFilterColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
RelativeValues = _originalRelativeValues;
|
||||
ShakePostExposure = _originalShakePostExposure;
|
||||
RemapPostExposureZero = _originalRemapPostExposureZero;
|
||||
RemapPostExposureOne = _originalRemapPostExposureOne;
|
||||
ShakeHueShift = _originalShakeHueShift;
|
||||
RemapHueShiftZero = _originalRemapHueShiftZero;
|
||||
RemapHueShiftOne = _originalRemapHueShiftOne;
|
||||
ShakeSaturation = _originalShakeSaturation;
|
||||
RemapSaturationZero = _originalRemapSaturationZero;
|
||||
RemapSaturationOne = _originalRemapSaturationOne;
|
||||
ShakeContrast = _originalShakeContrast;
|
||||
RemapContrastZero = _originalRemapContrastZero;
|
||||
RemapContrastOne = _originalRemapContrastOne;
|
||||
ColorFilterMode = _originalColorFilterMode;
|
||||
ColorFilterGradient = _originalColorFilterGradient;
|
||||
ColorFilterDestination = _originalColorFilterDestination;
|
||||
ColorFilterCurve = _originalColorFilterCurve;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMColorAdjustmentsShakeEvent_HDRP.Register(OnMMColorGradingShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMColorAdjustmentsShakeEvent_HDRP.Unregister(OnMMColorGradingShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMColorAdjustmentsShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve shakePostExposure, float remapPostExposureZero, float remapPostExposureOne,
|
||||
AnimationCurve shakeHueShift, float remapHueShiftZero, float remapHueShiftOne,
|
||||
AnimationCurve shakeSaturation, float remapSaturationZero, float remapSaturationOne,
|
||||
AnimationCurve shakeContrast, float remapContrastZero, float remapContrastOne,
|
||||
MMColorAdjustmentsShaker_HDRP.ColorFilterModes colorFilterMode, Gradient colorFilterGradient, Color colorFilterDestination,AnimationCurve colorFilterCurve,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve shakePostExposure, float remapPostExposureZero, float remapPostExposureOne,
|
||||
AnimationCurve shakeHueShift, float remapHueShiftZero, float remapHueShiftOne,
|
||||
AnimationCurve shakeSaturation, float remapSaturationZero, float remapSaturationOne,
|
||||
AnimationCurve shakeContrast, float remapContrastZero, float remapContrastOne,
|
||||
MMColorAdjustmentsShaker_HDRP.ColorFilterModes colorFilterMode, Gradient colorFilterGradient, Color colorFilterDestination,AnimationCurve colorFilterCurve,
|
||||
float duration, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(shakePostExposure, remapPostExposureZero, remapPostExposureOne,
|
||||
shakeHueShift, remapHueShiftZero, remapHueShiftOne,
|
||||
shakeSaturation, remapSaturationZero, remapSaturationOne,
|
||||
shakeContrast, remapContrastZero, remapContrastOne,
|
||||
colorFilterMode, colorFilterGradient, colorFilterDestination, colorFilterCurve,
|
||||
duration, relativeValues, attenuation, channelData, resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74e91560821f43e47a56cefccaf584cc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
393
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMDepthOfFieldShaker_HDRP.cs
vendored
Normal file
393
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMDepthOfFieldShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,393 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP depth of field post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMDepthOfFieldShaker_HDRP")]
|
||||
public class MMDepthOfFieldShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("AnimateFocusDistance", true)]
|
||||
public float RemapFocusDistanceOne = 3f;
|
||||
|
||||
|
||||
[MMInspectorGroup("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("AnimateNearRangeEnd", true)]
|
||||
public float RemapNearRangeEndOne = 3f;
|
||||
|
||||
[MMInspectorGroup("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("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")]
|
||||
[MMCondition("AnimateFarRangeEnd", true)]
|
||||
public float RemapFarRangeEndOne = 3f;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected DepthOfField _depthOfField;
|
||||
protected float _originalShakeDuration;
|
||||
|
||||
protected float _initialFocusDistance;
|
||||
protected float _initialNearRangeStart;
|
||||
protected float _initialNearRangeEnd;
|
||||
protected float _initialFarRangeStart;
|
||||
protected float _initialFarRangeEnd;
|
||||
|
||||
protected bool _originalAnimateFocusDistance;
|
||||
protected AnimationCurve _originalShakeFocusDistance;
|
||||
protected float _originalRemapFocusDistanceZero;
|
||||
protected float _originalRemapFocusDistanceOne;
|
||||
|
||||
protected bool _originalAnimateNearRangeStart;
|
||||
protected AnimationCurve _originalShakeNearRangeStart;
|
||||
protected float _originalRemapNearRangeStartZero;
|
||||
protected float _originalRemapNearRangeStartOne;
|
||||
protected bool _originalAnimateNearRangeEnd;
|
||||
protected AnimationCurve _originalShakeNearRangeEnd;
|
||||
protected float _originalRemapNearRangeEndZero;
|
||||
protected float _originalRemapNearRangeEndOne;
|
||||
protected bool _originalAnimateFarRangeStart;
|
||||
protected AnimationCurve _originalShakeFarRangeStart;
|
||||
protected float _originalRemapFarRangeStartZero;
|
||||
protected float _originalRemapFarRangeStartOne;
|
||||
protected bool _originalAnimateFarRangeEnd;
|
||||
protected AnimationCurve _originalShakeFarRangeEnd;
|
||||
protected float _originalRemapFarRangeEndZero;
|
||||
protected float _originalRemapFarRangeEndOne;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _depthOfField);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
if (AnimateFocusDistance)
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeFocusDistance, RemapFocusDistanceZero, RemapFocusDistanceOne, false, _initialFocusDistance);
|
||||
_depthOfField.focusDistance.Override(newValue);
|
||||
}
|
||||
if (AnimateNearRangeStart)
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeNearRangeStart, RemapNearRangeStartZero, RemapNearRangeStartOne, false, _initialNearRangeStart);
|
||||
_depthOfField.nearFocusStart.Override(newValue);
|
||||
}
|
||||
if (AnimateNearRangeEnd)
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeNearRangeEnd, RemapNearRangeEndZero, RemapNearRangeEndOne, false, _initialNearRangeEnd);
|
||||
_depthOfField.nearFocusEnd.Override(newValue);
|
||||
}
|
||||
if (AnimateFarRangeStart)
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeFarRangeStart, RemapFarRangeStartZero, RemapFarRangeStartOne, false, _initialFarRangeStart);
|
||||
_depthOfField.farFocusStart.Override(newValue);
|
||||
}
|
||||
if (AnimateFarRangeEnd)
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeFarRangeEnd, RemapFarRangeEndZero, RemapFarRangeEndOne, false, _initialFarRangeEnd);
|
||||
_depthOfField.farFocusEnd.Override(newValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialFocusDistance = _depthOfField.focusDistance.value;
|
||||
_initialNearRangeStart = _depthOfField.nearFocusStart.value;
|
||||
_initialNearRangeEnd = _depthOfField.nearFocusEnd.value;
|
||||
_initialFarRangeStart = _depthOfField.farFocusStart.value;
|
||||
_initialFarRangeEnd = _depthOfField.farFocusEnd.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnDepthOfFieldShakeEvent(float duration,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool animateFocusDistance = false, AnimationCurve shakeFocusDistance = null, float remapFocusDistanceZero = 0f, float remapFocusDistanceOne = 1f,
|
||||
bool animateNearRangeStart = false, AnimationCurve shakeNearRangeStart = null,float remapNearRangeStartZero = 0f, float remapNearRangeStartOne = 0f,
|
||||
bool animateNearRangeEnd = false, AnimationCurve shakeNearRangeEnd = null,float remapNearRangeEndZero = 0f, float remapNearRangeEndOne = 0f,
|
||||
bool animateFarRangeStart = false, AnimationCurve shakeFarRangeStart = null,float remapFarRangeStartZero = 0f, float remapFarRangeStartOne = 0f,
|
||||
bool animateFarRangeEnd = false, AnimationCurve shakeFarRangeEnd = null,float remapFarRangeEndZero = 0f, float remapFarRangeEndOne = 0f)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
|
||||
_originalAnimateFocusDistance = AnimateFocusDistance;
|
||||
_originalShakeFocusDistance = ShakeFocusDistance;
|
||||
_originalRemapFocusDistanceZero = RemapFocusDistanceZero;
|
||||
_originalRemapFocusDistanceOne = RemapFocusDistanceOne;
|
||||
_originalAnimateNearRangeStart = AnimateNearRangeStart;
|
||||
_originalShakeNearRangeStart = ShakeNearRangeStart;
|
||||
_originalRemapNearRangeStartZero = RemapNearRangeStartZero;
|
||||
_originalRemapNearRangeStartOne = RemapNearRangeStartOne;
|
||||
_originalAnimateNearRangeEnd = AnimateNearRangeEnd;
|
||||
_originalShakeNearRangeEnd = ShakeNearRangeEnd;
|
||||
_originalRemapNearRangeEndZero = RemapNearRangeEndZero;
|
||||
_originalRemapNearRangeEndOne = RemapNearRangeEndOne;
|
||||
_originalAnimateFarRangeStart = AnimateFarRangeStart;
|
||||
_originalShakeFarRangeStart = ShakeFarRangeStart;
|
||||
_originalRemapFarRangeStartZero = RemapFarRangeStartZero;
|
||||
_originalRemapFarRangeStartOne = RemapFarRangeStartOne;
|
||||
_originalAnimateFarRangeEnd = AnimateFarRangeEnd;
|
||||
_originalShakeFarRangeEnd = ShakeFarRangeEnd;
|
||||
_originalRemapFarRangeEndZero = RemapFarRangeEndZero;
|
||||
_originalRemapFarRangeEndOne = RemapFarRangeEndOne;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ForwardDirection = forwardDirection;
|
||||
|
||||
AnimateFocusDistance = animateFocusDistance;
|
||||
ShakeFocusDistance = shakeFocusDistance;
|
||||
RemapFocusDistanceZero = remapFocusDistanceZero;
|
||||
RemapFocusDistanceOne = remapFocusDistanceOne;
|
||||
|
||||
AnimateNearRangeStart = animateNearRangeStart;
|
||||
ShakeNearRangeStart = shakeNearRangeStart;
|
||||
RemapNearRangeStartZero = remapNearRangeStartZero;
|
||||
RemapNearRangeStartOne = remapNearRangeStartOne;
|
||||
AnimateNearRangeEnd = animateNearRangeEnd;
|
||||
ShakeNearRangeEnd = shakeNearRangeEnd;
|
||||
RemapNearRangeEndZero = remapNearRangeEndZero;
|
||||
RemapNearRangeEndOne = remapNearRangeEndOne;
|
||||
AnimateFarRangeStart = animateFarRangeStart;
|
||||
ShakeFarRangeStart = shakeFarRangeStart;
|
||||
RemapFarRangeStartZero = remapFarRangeStartZero;
|
||||
RemapFarRangeStartOne = remapFarRangeStartOne;
|
||||
AnimateFarRangeEnd = animateFarRangeEnd;
|
||||
ShakeFarRangeEnd = shakeFarRangeEnd;
|
||||
RemapFarRangeEndZero = remapFarRangeEndZero;
|
||||
RemapFarRangeEndOne = remapFarRangeEndOne;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_depthOfField.focusDistance.Override(_initialFocusDistance);
|
||||
_depthOfField.nearFocusStart.Override(_initialNearRangeStart);
|
||||
_depthOfField.nearFocusEnd.Override(_initialNearRangeEnd);
|
||||
_depthOfField.farFocusStart.Override(_initialFarRangeStart);
|
||||
_depthOfField.farFocusEnd.Override(_initialFarRangeEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
|
||||
AnimateFocusDistance = _originalAnimateFocusDistance;
|
||||
ShakeFocusDistance = _originalShakeFocusDistance;
|
||||
RemapFocusDistanceZero = _originalRemapFocusDistanceZero;
|
||||
RemapFocusDistanceOne = _originalRemapFocusDistanceOne;
|
||||
AnimateNearRangeStart = _originalAnimateNearRangeStart;
|
||||
ShakeNearRangeStart = _originalShakeNearRangeStart;
|
||||
RemapNearRangeStartZero = _originalRemapNearRangeStartZero;
|
||||
RemapNearRangeStartOne = _originalRemapNearRangeStartOne;
|
||||
AnimateNearRangeEnd = _originalAnimateNearRangeEnd;
|
||||
ShakeNearRangeEnd = _originalShakeNearRangeEnd;
|
||||
RemapNearRangeEndZero = _originalRemapNearRangeEndZero;
|
||||
RemapNearRangeEndOne = _originalRemapNearRangeEndOne;
|
||||
AnimateFarRangeStart = _originalAnimateFarRangeStart;
|
||||
ShakeFarRangeStart = _originalShakeFarRangeStart;
|
||||
RemapFarRangeStartZero = _originalRemapFarRangeStartZero;
|
||||
RemapFarRangeStartOne = _originalRemapFarRangeStartOne;
|
||||
AnimateFarRangeEnd = _originalAnimateFarRangeEnd;
|
||||
ShakeFarRangeEnd = _originalShakeFarRangeEnd;
|
||||
RemapFarRangeEndZero = _originalRemapFarRangeEndZero;
|
||||
RemapFarRangeEndOne = _originalRemapFarRangeEndOne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMDepthOfFieldShakeEvent_HDRP.Register(OnDepthOfFieldShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMDepthOfFieldShakeEvent_HDRP.Unregister(OnDepthOfFieldShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMDepthOfFieldShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(float duration,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool animateFocusDistance = false, AnimationCurve shakeFocusDistance = null, float remapFocusDistanceZero = 0f, float remapFocusDistanceOne = 1f,
|
||||
bool animateNearRangeStart = false, AnimationCurve shakeNearRangeStart = null,float remapNearRangeStartZero = 0f, float remapNearRangeStartOne = 0f,
|
||||
bool animateNearRangeEnd = false, AnimationCurve shakeNearRangeEnd = null,float remapNearRangeEndZero = 0f, float remapNearRangeEndOne = 0f,
|
||||
bool animateFarRangeStart = false, AnimationCurve shakeFarRangeStart = null,float remapFarRangeStartZero = 0f, float remapFarRangeStartOne = 0f,
|
||||
bool animateFarRangeEnd = false, AnimationCurve shakeFarRangeEnd = null,float remapFarRangeEndZero = 0f, float remapFarRangeEndOne = 0f);
|
||||
|
||||
static public void Trigger(float duration,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool animateFocusDistance = false, AnimationCurve shakeFocusDistance = null, float remapFocusDistanceZero = 0f, float remapFocusDistanceOne = 1f,
|
||||
bool animateNearRangeStart = false, AnimationCurve shakeNearRangeStart = null,float remapNearRangeStartZero = 0f, float remapNearRangeStartOne = 0f,
|
||||
bool animateNearRangeEnd = false, AnimationCurve shakeNearRangeEnd = null,float remapNearRangeEndZero = 0f, float remapNearRangeEndOne = 0f,
|
||||
bool animateFarRangeStart = false, AnimationCurve shakeFarRangeStart = null,float remapFarRangeStartZero = 0f, float remapFarRangeStartOne = 0f,
|
||||
bool animateFarRangeEnd = false, AnimationCurve shakeFarRangeEnd = null,float remapFarRangeEndZero = 0f, float remapFarRangeEndOne = 0f)
|
||||
{
|
||||
OnEvent?.Invoke(duration, attenuation, channelData, resetShakerValuesAfterShake,
|
||||
resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore, animateFocusDistance, shakeFocusDistance, remapFocusDistanceZero, remapFocusDistanceOne,
|
||||
animateNearRangeStart, shakeNearRangeStart, remapNearRangeStartZero, remapNearRangeStartOne,
|
||||
animateNearRangeEnd, shakeNearRangeEnd, remapNearRangeEndZero, remapNearRangeEndOne,
|
||||
animateFarRangeStart, shakeFarRangeStart, remapFarRangeStartZero, remapFarRangeStartOne,
|
||||
animateFarRangeEnd, shakeFarRangeEnd,remapFarRangeEndZero,remapFarRangeEndOne);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMDepthOfFieldShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMDepthOfFieldShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8dccaa5e1799e3b48ab214e494816880
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
191
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMExposureShaker_HDRP.cs
vendored
Normal file
191
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMExposureShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP exposure post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMExposureShaker_HDRP")]
|
||||
public class MMExposureShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Exposure Intensity", true, 46)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value on")]
|
||||
public AnimationCurve ShakeFixedExposure = 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected Exposure _exposure;
|
||||
protected float _initialFixedExposure;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeFixedExposure;
|
||||
protected float _originalRemapFixedExposureZero;
|
||||
protected float _originalRemapFixedExposureOne;
|
||||
protected bool _originalRelativeFixedExposure;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _exposure);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeFixedExposure, RemapFixedExposureZero, RemapFixedExposureOne, RelativeIntensity, _initialFixedExposure);
|
||||
_exposure.fixedExposure.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialFixedExposure = _exposure.fixedExposure.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnExposureShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeFixedExposure = ShakeFixedExposure;
|
||||
_originalRemapFixedExposureZero = RemapFixedExposureZero;
|
||||
_originalRemapFixedExposureOne = RemapFixedExposureOne;
|
||||
_originalRelativeFixedExposure = RelativeIntensity;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeFixedExposure = intensity;
|
||||
RemapFixedExposureZero = remapMin * attenuation;
|
||||
RemapFixedExposureOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_exposure.fixedExposure.Override(_initialFixedExposure);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeFixedExposure = _originalShakeFixedExposure;
|
||||
RemapFixedExposureZero = _originalRemapFixedExposureZero;
|
||||
RemapFixedExposureOne = _originalRemapFixedExposureOne;
|
||||
RelativeIntensity = _originalRelativeFixedExposure;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMExposureShakeEvent_HDRP.Register(OnExposureShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMExposureShakeEvent_HDRP.Unregister(OnExposureShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger exposure shakes
|
||||
/// </summary>
|
||||
public struct MMExposureShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve fixedExposure, float duration, float remapMin, float remapMax, bool relativeFixedExposure = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve fixedExposure, float duration, float remapMin, float remapMax, bool relativeFixedExposure = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(fixedExposure, duration, remapMin, remapMax, relativeFixedExposure, attenuation, channelData, resetShakerValuesAfterShake,
|
||||
resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMExposureShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMExposureShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cacc4f51dca0d494dabb441565c23f0b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
192
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMFilmGrainShaker_HDRP.cs
vendored
Normal file
192
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMFilmGrainShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP FilmGrain post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMFilmGrainShaker_HDRP")]
|
||||
public class MMFilmGrainShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Film Grain Intensity", true, 47)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value 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")]
|
||||
[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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected FilmGrain _filmGrain;
|
||||
protected float _initialIntensity;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected bool _originalRelativeIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _filmGrain);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, _initialIntensity);
|
||||
_filmGrain.intensity.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _filmGrain.intensity.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnFilmGrainShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeIntensity;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_filmGrain.intensity.Override(_initialIntensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeIntensity = _originalRelativeIntensity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMFilmGrainShakeEvent_HDRP.Register(OnFilmGrainShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMFilmGrainShakeEvent_HDRP.Unregister(OnFilmGrainShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger FilmGrain shakes
|
||||
/// </summary>
|
||||
public struct MMFilmGrainShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, relativeIntensity, attenuation, channelData, resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMFilmGrainShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMFilmGrainShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2f88b719c3eddc45be16396a493f8d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
210
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMLensDistortionShaker_HDRP.cs
vendored
Normal file
210
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMLensDistortionShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP lens distortion post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMLensDistortionShaker_HDRP")]
|
||||
public class MMLensDistortionShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Lens Distortion Intensity", true, 47)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value on")]
|
||||
public AnimationCurve ShakeIntensity = 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 = 0.5f;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected LensDistortion _lensDistortion;
|
||||
protected float _initialIntensity;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected bool _originalRelativeIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _lensDistortion);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When that shaker gets added, we initialize its shake duration
|
||||
/// </summary>
|
||||
protected virtual void Reset()
|
||||
{
|
||||
ShakeDuration = 0.8f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, _initialIntensity);
|
||||
_lensDistortion.intensity.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _lensDistortion.intensity.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnMMLensDistortionShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeIntensity;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_lensDistortion.intensity.Override(_initialIntensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeIntensity = _originalRelativeIntensity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMLensDistortionShakeEvent_HDRP.Register(OnMMLensDistortionShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMLensDistortionShakeEvent_HDRP.Unregister(OnMMLensDistortionShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMLensDistortionShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, relativeIntensity, attenuation, channelData,
|
||||
resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 519fc1b1af1286148b6fbb86b4ef2eeb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
191
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMMotionBlurShaker_HDRP.cs
vendored
Normal file
191
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMMotionBlurShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP vignette post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMMotionBlurShaker_HDRP")]
|
||||
public class MMMotionBlurShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Motion Blur Intensity", true, 48)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value 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 = 1000f;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected MotionBlur _motionBlur;
|
||||
protected float _initialIntensity;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected bool _originalRelativeIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _motionBlur);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, _initialIntensity);
|
||||
_motionBlur.intensity.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _motionBlur.intensity.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnMotionBlurShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeIntensity;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_motionBlur.intensity.Override(_initialIntensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeIntensity = _originalRelativeIntensity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMMotionBlurShakeEvent_HDRP.Register(OnMotionBlurShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMMotionBlurShakeEvent_HDRP.Unregister(OnMotionBlurShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMMotionBlurShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, relativeIntensity, attenuation, channelData,
|
||||
resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMMotionBlurShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMMotionBlurShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbf1b6f8b44acf042a0f2bed486492e9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
193
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMPaniniProjectionShaker_HDRP.cs
vendored
Normal file
193
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMPaniniProjectionShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP vignette post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMPaniniProjectionShaker_HDRP")]
|
||||
public class MMPaniniProjectionShaker_HDRP : MMShaker
|
||||
{
|
||||
[MMInspectorGroup("Panini Projection Distance", true, 49)]
|
||||
/// 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected PaniniProjection _paniniProjection;
|
||||
protected float _initialDistance;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeDistance;
|
||||
protected float _originalRemapDistanceZero;
|
||||
protected float _originalRemapDistanceOne;
|
||||
protected bool _originalRelativeDistance;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _paniniProjection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeDistance, RemapDistanceZero, RemapDistanceOne, RelativeDistance, _initialDistance);
|
||||
_paniniProjection.distance.Override(newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialDistance = _paniniProjection.distance.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="distance"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeDistance"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnPaniniProjectionShakeEvent(AnimationCurve distance, float duration, float remapMin, float remapMax, bool relativeDistance = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeDistance = ShakeDistance;
|
||||
_originalRemapDistanceZero = RemapDistanceZero;
|
||||
_originalRemapDistanceOne = RemapDistanceOne;
|
||||
_originalRelativeDistance = RelativeDistance;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeDistance = distance;
|
||||
RemapDistanceZero = remapMin * attenuation;
|
||||
RemapDistanceOne = remapMax * attenuation;
|
||||
RelativeDistance = relativeDistance;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_paniniProjection.distance.Override(_initialDistance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeDistance = _originalShakeDistance;
|
||||
RemapDistanceZero = _originalRemapDistanceZero;
|
||||
RemapDistanceOne = _originalRemapDistanceOne;
|
||||
RelativeDistance = _originalRelativeDistance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMPaniniProjectionShakeEvent_HDRP.Register(OnPaniniProjectionShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMPaniniProjectionShakeEvent_HDRP.Unregister(OnPaniniProjectionShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMPaniniProjectionShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve distance, float duration, float remapMin, float remapMax, bool relativeDistance = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve distance, float duration, float remapMin, float remapMax, bool relativeDistance = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(distance, duration, remapMin, remapMax, relativeDistance, attenuation, channelData, resetShakerValuesAfterShake,
|
||||
resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00b9fc554bc35094d9e423683c81474e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
243
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMVignetteShaker_HDRP.cs
vendored
Normal file
243
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMVignetteShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a HDRP vignette post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMVignetteShaker_HDRP")]
|
||||
public class MMVignetteShaker_HDRP : MMShaker
|
||||
{
|
||||
[Header("Intensity")]
|
||||
[MMInspectorGroup("Vignette Intensity", true, 46)]
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeIntensity = false;
|
||||
/// the curve used to animate the intensity value on
|
||||
[Tooltip("the curve used to animate the intensity value 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")]
|
||||
[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("Vignette Color", true, 60)]
|
||||
/// 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected Vignette _vignette;
|
||||
protected float _initialIntensity;
|
||||
protected float _originalShakeDuration;
|
||||
protected AnimationCurve _originalShakeIntensity;
|
||||
protected float _originalRemapIntensityZero;
|
||||
protected float _originalRemapIntensityOne;
|
||||
protected bool _originalRelativeIntensity;
|
||||
protected bool _originalInterpolateColor;
|
||||
protected AnimationCurve _originalColorCurve;
|
||||
protected float _originalRemapColorZero;
|
||||
protected float _originalRemapColorOne;
|
||||
protected Color _originalTargetColor;
|
||||
protected Color _initialColor;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _vignette);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newValue = ShakeFloat(ShakeIntensity, RemapIntensityZero, RemapIntensityOne, RelativeIntensity, _initialIntensity);
|
||||
_vignette.intensity.Override(newValue);
|
||||
|
||||
if (InterpolateColor)
|
||||
{
|
||||
float newColorValue = ShakeFloat(ColorCurve, RemapColorZero, RemapColorOne, RelativeIntensity, 0);
|
||||
_vignette.color.Override(Color.Lerp(_initialColor, TargetColor, newColorValue));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialIntensity = _vignette.intensity.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="intensity"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeIntensity"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnVignetteShakeEvent(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool interpolateColor = false, AnimationCurve colorCurve = null, float remapColorZero = 0f, float remapColorOne = 1f, Color targetColor = default(Color))
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeIntensity = ShakeIntensity;
|
||||
_originalRemapIntensityZero = RemapIntensityZero;
|
||||
_originalRemapIntensityOne = RemapIntensityOne;
|
||||
_originalRelativeIntensity = RelativeIntensity;
|
||||
_originalInterpolateColor = InterpolateColor;
|
||||
_originalColorCurve = ColorCurve;
|
||||
_originalRemapColorZero = RemapColorZero;
|
||||
_originalRemapColorOne = RemapColorOne;
|
||||
_originalTargetColor = TargetColor;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeIntensity = intensity;
|
||||
RemapIntensityZero = remapMin * attenuation;
|
||||
RemapIntensityOne = remapMax * attenuation;
|
||||
RelativeIntensity = relativeIntensity;
|
||||
ForwardDirection = forwardDirection;
|
||||
InterpolateColor = interpolateColor;
|
||||
ColorCurve = colorCurve;
|
||||
RemapColorZero = remapColorZero;
|
||||
RemapColorOne = remapColorOne;
|
||||
TargetColor = targetColor;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_vignette.intensity.Override(_initialIntensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeIntensity = _originalShakeIntensity;
|
||||
RemapIntensityZero = _originalRemapIntensityZero;
|
||||
RemapIntensityOne = _originalRemapIntensityOne;
|
||||
RelativeIntensity = _originalRelativeIntensity;
|
||||
InterpolateColor = _originalInterpolateColor;
|
||||
ColorCurve = _originalColorCurve;
|
||||
RemapColorZero = _originalRemapColorZero;
|
||||
RemapColorOne = _originalRemapColorOne;
|
||||
TargetColor = _originalTargetColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMVignetteShakeEvent_HDRP.Register(OnVignetteShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMVignetteShakeEvent_HDRP.Unregister(OnVignetteShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMVignetteShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool interpolateColor = false, AnimationCurve colorCurve = null, float remapColorZero = 0f, float remapColorOne = 1f, Color targetColor = default(Color));
|
||||
|
||||
static public void Trigger(AnimationCurve intensity, float duration, float remapMin, float remapMax, bool relativeIntensity = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false,
|
||||
bool interpolateColor = false, AnimationCurve colorCurve = null, float remapColorZero = 0f, float remapColorOne = 1f, Color targetColor = default(Color))
|
||||
{
|
||||
OnEvent?.Invoke(intensity, duration, remapMin, remapMax, relativeIntensity, attenuation, channelData, resetShakerValuesAfterShake,
|
||||
resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore, interpolateColor, colorCurve, remapColorZero, remapColorOne, targetColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMVignetteShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMVignetteShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d92a948b1d89a964dad3e880ab3b9712
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
228
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMWhiteBalanceShaker_HDRP.cs
vendored
Normal file
228
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMWhiteBalanceShaker_HDRP.cs
vendored
Normal file
@@ -0,0 +1,228 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.Tools;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
#endif
|
||||
|
||||
namespace MoreMountains.FeedbacksForThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// Add this class to a Camera with a white balance post processing and it'll be able to "shake" its values by getting events
|
||||
/// </summary>
|
||||
#if MM_HDRP
|
||||
[RequireComponent(typeof(Volume))]
|
||||
#endif
|
||||
[AddComponentMenu("More Mountains/Feedbacks/Shakers/PostProcessing/MMWhiteBalanceShaker_HDRP")]
|
||||
public class MMWhiteBalanceShaker_HDRP : MMShaker
|
||||
{
|
||||
/// whether or not to add to the initial value
|
||||
[Tooltip("whether or not to add to the initial value")]
|
||||
public bool RelativeValues = true;
|
||||
|
||||
[MMInspectorGroup("Temperature", true, 47)]
|
||||
/// 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;
|
||||
|
||||
[MMInspectorGroup("Tint", true, 48)]
|
||||
/// 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;
|
||||
|
||||
#if MM_HDRP
|
||||
protected Volume _volume;
|
||||
protected WhiteBalance _whiteBalance;
|
||||
protected float _initialTemperature;
|
||||
protected float _initialTint;
|
||||
protected float _originalShakeDuration;
|
||||
protected bool _originalRelativeValues;
|
||||
protected AnimationCurve _originalShakeTemperature;
|
||||
protected float _originalRemapTemperatureZero;
|
||||
protected float _originalRemapTemperatureOne;
|
||||
protected AnimationCurve _originalShakeTint;
|
||||
protected float _originalRemapTintZero;
|
||||
protected float _originalRemapTintOne;
|
||||
|
||||
/// <summary>
|
||||
/// On init we initialize our values
|
||||
/// </summary>
|
||||
protected override void Initialization()
|
||||
{
|
||||
base.Initialization();
|
||||
_volume = this.gameObject.GetComponent<Volume>();
|
||||
_volume.profile.TryGet(out _whiteBalance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shakes values over time
|
||||
/// </summary>
|
||||
protected override void Shake()
|
||||
{
|
||||
float newTemperature = ShakeFloat(ShakeTemperature, RemapTemperatureZero, RemapTemperatureOne, RelativeValues, _initialTemperature);
|
||||
_whiteBalance.temperature.Override(newTemperature);
|
||||
float newTint = ShakeFloat(ShakeTint, RemapTintZero, RemapTintOne, RelativeValues, _initialTint);
|
||||
_whiteBalance.tint.Override(newTint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects initial values on the target
|
||||
/// </summary>
|
||||
protected override void GrabInitialValues()
|
||||
{
|
||||
_initialTemperature = _whiteBalance.temperature.value;
|
||||
_initialTint = _whiteBalance.tint.value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When we get the appropriate event, we trigger a shake
|
||||
/// </summary>
|
||||
/// <param name="temperature"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="amplitude"></param>
|
||||
/// <param name="relativeValues"></param>
|
||||
/// <param name="attenuation"></param>
|
||||
/// <param name="channel"></param>
|
||||
public virtual void OnWhiteBalanceShakeEvent(AnimationCurve temperature, float duration, float remapTemperatureMin, float remapTemperatureMax,
|
||||
AnimationCurve tint, float remapTintMin, float remapTintMax, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
if (!CheckEventAllowed(channelData) || (!Interruptible && Shaking))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (restore)
|
||||
{
|
||||
ResetTargetValues();
|
||||
return;
|
||||
}
|
||||
|
||||
_resetShakerValuesAfterShake = resetShakerValuesAfterShake;
|
||||
_resetTargetValuesAfterShake = resetTargetValuesAfterShake;
|
||||
|
||||
if (resetShakerValuesAfterShake)
|
||||
{
|
||||
_originalShakeDuration = ShakeDuration;
|
||||
_originalShakeTemperature = ShakeTemperature;
|
||||
_originalRemapTemperatureZero = RemapTemperatureZero;
|
||||
_originalRemapTemperatureOne = RemapTemperatureOne;
|
||||
_originalRelativeValues = RelativeValues;
|
||||
_originalShakeTint = ShakeTint;
|
||||
_originalRemapTintZero = RemapTintZero;
|
||||
_originalRemapTintOne = RemapTintOne;
|
||||
}
|
||||
|
||||
if (!OnlyUseShakerValues)
|
||||
{
|
||||
TimescaleMode = timescaleMode;
|
||||
ShakeDuration = duration;
|
||||
ShakeTemperature = temperature;
|
||||
RemapTemperatureZero = remapTemperatureMin * attenuation;
|
||||
RemapTemperatureOne = remapTemperatureMax * attenuation;
|
||||
RelativeValues = relativeValues;
|
||||
ShakeTint = tint;
|
||||
RemapTintZero = remapTintMin;
|
||||
RemapTintOne = remapTintMax;
|
||||
ForwardDirection = forwardDirection;
|
||||
}
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the target's values
|
||||
/// </summary>
|
||||
protected override void ResetTargetValues()
|
||||
{
|
||||
base.ResetTargetValues();
|
||||
_whiteBalance.temperature.Override(_initialTemperature);
|
||||
_whiteBalance.tint.Override(_initialTint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the shaker's values
|
||||
/// </summary>
|
||||
protected override void ResetShakerValues()
|
||||
{
|
||||
base.ResetShakerValues();
|
||||
ShakeDuration = _originalShakeDuration;
|
||||
ShakeTemperature = _originalShakeTemperature;
|
||||
RemapTemperatureZero = _originalRemapTemperatureZero;
|
||||
RemapTemperatureOne = _originalRemapTemperatureOne;
|
||||
RelativeValues = _originalRelativeValues;
|
||||
ShakeTint = _originalShakeTint;
|
||||
RemapTintZero = _originalRemapTintZero;
|
||||
RemapTintOne = _originalRemapTintOne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts listening for events
|
||||
/// </summary>
|
||||
public override void StartListening()
|
||||
{
|
||||
base.StartListening();
|
||||
MMWhiteBalanceShakeEvent_HDRP.Register(OnWhiteBalanceShakeEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for events
|
||||
/// </summary>
|
||||
public override void StopListening()
|
||||
{
|
||||
base.StopListening();
|
||||
MMWhiteBalanceShakeEvent_HDRP.Unregister(OnWhiteBalanceShakeEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An event used to trigger vignette shakes
|
||||
/// </summary>
|
||||
public struct MMWhiteBalanceShakeEvent_HDRP
|
||||
{
|
||||
static private event Delegate OnEvent;
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
|
||||
static public void Register(Delegate callback) { OnEvent += callback; }
|
||||
static public void Unregister(Delegate callback) { OnEvent -= callback; }
|
||||
|
||||
public delegate void Delegate(AnimationCurve temperature, float duration, float remapTemperatureMin, float remapTemperatureMax,
|
||||
AnimationCurve tint, float remapTintMin, float remapTintMax, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false);
|
||||
|
||||
static public void Trigger(AnimationCurve temperature, float duration, float remapTemperatureMin, float remapTemperatureMax,
|
||||
AnimationCurve tint, float remapTintMin, float remapTintMax, bool relativeValues = false,
|
||||
float attenuation = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true,
|
||||
bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
|
||||
{
|
||||
OnEvent?.Invoke(temperature, duration, remapTemperatureMin, remapTemperatureMax,
|
||||
tint, remapTintMin, remapTintMax, relativeValues,
|
||||
attenuation, channelData, resetShakerValuesAfterShake, resetTargetValuesAfterShake, forwardDirection, timescaleMode, stop, restore);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMWhiteBalanceShaker_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Shakers/MMWhiteBalanceShaker_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa659f9a4e4d1ac44942408d91a6d90c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs.meta
vendored
Normal file
8
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02bbc4cc2e8216141a1611c34fd4d3de
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringBloomIntensity_HDRP.cs
vendored
Normal file
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringBloomIntensity_HDRP.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringBloomIntensity_HDRP")]
|
||||
public class MMSpringBloomIntensity_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected Bloom _bloom;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _bloom);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _bloom.intensity.value;
|
||||
set => _bloom.intensity.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0056b25dc228574191f188adc74a57a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringChromaticAberrationIntensity_HDRP")]
|
||||
public class MMSpringChromaticAberrationIntensity_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected ChromaticAberration _chromaticAberration;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _chromaticAberration);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _chromaticAberration.intensity.value;
|
||||
set => _chromaticAberration.intensity.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bba9508cc683bc449975959a80f4ac6d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringColorAdjustmentsContrast_HDRP")]
|
||||
public class MMSpringColorAdjustmentsContrast_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected ColorAdjustments _colorAdjustments;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _colorAdjustments);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _colorAdjustments.contrast.value;
|
||||
set => _colorAdjustments.contrast.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1f799d610ab96d409225e15095ce227
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringColorAdjustmentsHueShift_HDRP")]
|
||||
public class MMSpringColorAdjustmentsHueShift_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected ColorAdjustments _colorAdjustments;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _colorAdjustments);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _colorAdjustments.hueShift.value;
|
||||
set => _colorAdjustments.hueShift.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2e66687d665f8a4bb4d00f4b8ca3d1a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringColorAdjustmentsSaturation_HDRP")]
|
||||
public class MMSpringColorAdjustmentsSaturation_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected ColorAdjustments _colorAdjustments;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _colorAdjustments);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _colorAdjustments.saturation.value;
|
||||
set => _colorAdjustments.saturation.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0c6834fc909cbf439bdf1d669ef2958
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringDepthOfFieldFocusDistance_HDRP")]
|
||||
public class MMSpringDepthOfFieldFocusDistance_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected DepthOfField _depthOfField;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _depthOfField);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _depthOfField.focusDistance.value;
|
||||
set => _depthOfField.focusDistance.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7969c2e1fc64bc64b8e2c338f430fa49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringLensDistortionIntensity_HDRP")]
|
||||
public class MMSpringLensDistortionIntensity_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected LensDistortion _lensDistortion;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _lensDistortion);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _lensDistortion.intensity.value;
|
||||
set => _lensDistortion.intensity.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e43c981f3033d36468c3cf0e9cbb5ef2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringMotionBlurIntensity_HDRP")]
|
||||
public class MMSpringMotionBlurIntensity_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected MotionBlur _motionBlur;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _motionBlur);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _motionBlur.intensity.value;
|
||||
set => _motionBlur.intensity.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eab722862e080484cab1481e2481a922
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringPaniniProjectionDistance_HDRP")]
|
||||
public class MMSpringPaniniProjectionDistance_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected PaniniProjection _paniniProjection;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _paniniProjection);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _paniniProjection.distance.value;
|
||||
set => _paniniProjection.distance.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20aa8b632ddbeab44ab5759e02005195
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteCenter_HDRP.cs
vendored
Normal file
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteCenter_HDRP.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringVignetteCenter_HDRP")]
|
||||
public class MMSpringVignetteCenter_HDRP : MMSpringVector2Component<Volume>
|
||||
{
|
||||
protected Vignette _vignette;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _vignette);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override Vector2 TargetVector2
|
||||
{
|
||||
get => _vignette.center.value;
|
||||
set => _vignette.center.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9680118cd018daf4e92199c3b12ba729
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteColor_HDRP.cs
vendored
Normal file
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteColor_HDRP.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
#if MM_HDRP
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringVignetteColor_HDRP")]
|
||||
public class MMSpringVignetteColor_HDRP : MMSpringColorComponent<Volume>
|
||||
{
|
||||
protected Vignette _vignette;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _vignette);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override Color TargetColor
|
||||
{
|
||||
get => _vignette.color.value;
|
||||
set => _vignette.color.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteColor_HDRP.cs.meta
vendored
Normal file
11
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteColor_HDRP.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15ea18286341f8e4aa898fb1b8eb2cfa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteIntensity_HDRP.cs
vendored
Normal file
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringVignetteIntensity_HDRP.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringVignetteIntensity_HDRP")]
|
||||
public class MMSpringVignetteIntensity_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected Vignette _vignette;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _vignette);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _vignette.intensity.value;
|
||||
set => _vignette.intensity.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6cf2103244e0c94f993f2f0f281b0c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringWhiteBalanceTemperature_HDRP")]
|
||||
public class MMSpringWhiteBalanceTemperature_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected WhiteBalance _whiteBalance;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _whiteBalance);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _whiteBalance.temperature.value;
|
||||
set => _whiteBalance.temperature.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0516121ec1782264898972570320fbc9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringWhiteBalanceTint_HDRP.cs
vendored
Normal file
30
Assets/Feel/MMFeedbacks/MMFeedbacksForThirdParty/HDRP/Springs/MMSpringWhiteBalanceTint_HDRP.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
#if MM_HDRP
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace MoreMountains.Feedbacks
|
||||
{
|
||||
[AddComponentMenu("More Mountains/Springs/MMSpringWhiteBalanceTint_HDRP")]
|
||||
public class MMSpringWhiteBalanceTint_HDRP : MMSpringFloatComponent<Volume>
|
||||
{
|
||||
protected WhiteBalance _whiteBalance;
|
||||
|
||||
protected override void Initialization()
|
||||
{
|
||||
if (Target == null)
|
||||
{
|
||||
Target = this.gameObject.GetComponent<Volume>();
|
||||
}
|
||||
Target.profile.TryGet(out _whiteBalance);
|
||||
base.Initialization();
|
||||
}
|
||||
|
||||
public override float TargetFloat
|
||||
{
|
||||
get => _whiteBalance.tint.value;
|
||||
set => _whiteBalance.tint.Override(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 732c2868ba8b5ae43b78fceeb122bda4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user