调整FEEL扩展

This commit is contained in:
SoulliesOfficial
2025-12-17 04:52:56 -05:00
parent d15957c719
commit c3914da4ac
4 changed files with 104 additions and 244 deletions

View File

@@ -12,9 +12,9 @@ namespace MoreMountains.Feedbacks
/// 需要在 Virtual Camera 上挂载 MMCinemachineRotationShaker。
/// </summary>
[AddComponentMenu("")]
[FeedbackPath("Camera/Camera Rotation Shake")]
[FeedbackPath("Camera/Cinemachine Rotation Shake")]
[FeedbackHelp("控制 Cinemachine 相机的旋转抖动。X/Y 轴作用于 Shaker 指定的 FollowTargetZ 轴作用于相机的 Dutch。需要在 Virtual Camera 上挂载 MMCinemachineRotationShaker。")]
public class MMF_CameraRotation : MMF_Feedback
public class MMF_CinemachineRotation : MMF_Feedback
{
/// 用于禁用此类 Feedback 的静态开关
public static bool FeedbackTypeAuthorized = true;
@@ -71,7 +71,7 @@ namespace MoreMountains.Feedbacks
intensityMultiplier *= AttenuationCurve.Evaluate(normalizedDistance);
}
MMCameraRotationShakeEvent.Trigger(
MMCinemachineRotationShakeEvent.Trigger(
ShakeCurve,
FeedbackDuration,
RotationAmplitude,
@@ -89,13 +89,13 @@ namespace MoreMountains.Feedbacks
{
if (!Active || !FeedbackTypeAuthorized) return;
base.CustomStopFeedback(position, feedbacksIntensity);
MMCameraRotationShakeEvent.Trigger(ShakeCurve, FeedbackDuration, RotationAmplitude, 0f, 1f, false, stop: true);
MMCinemachineRotationShakeEvent.Trigger(ShakeCurve, FeedbackDuration, RotationAmplitude, 0f, 1f, false, stop: true);
}
protected override void CustomRestoreInitialValues()
{
if (!Active || !FeedbackTypeAuthorized) return;
MMCameraRotationShakeEvent.Trigger(ShakeCurve, FeedbackDuration, RotationAmplitude, 0f, 1f, false, restore: true);
MMCinemachineRotationShakeEvent.Trigger(ShakeCurve, FeedbackDuration, RotationAmplitude, 0f, 1f, false, restore: true);
}
public override void OnDrawGizmosSelectedHandler()

View File

@@ -10,7 +10,7 @@ using Unity.Cinemachine;
namespace MoreMountains.FeedbacksForThirdParty
{
// 定义事件结构
public struct MMCameraRotationShakeEvent
public struct MMCinemachineRotationShakeEvent
{
static private event Delegate OnEvent;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] private static void RuntimeInitialization() { OnEvent = null; }
@@ -138,7 +138,7 @@ namespace MoreMountains.FeedbacksForThirdParty
ShakeCurve = _originalShakeCurve;
}
public virtual void OnMMCameraRotationShakeEvent(AnimationCurve shakeCurve, float duration, Vector3 rotationAmplitude, float remapMin, float remapMax, bool relative, float feedbacksIntensity = 1.0f, MMChannelData channelData = null, bool resetShakerValuesAfterShake = true, bool resetTargetValuesAfterShake = true, bool forwardDirection = true, TimescaleModes timescaleMode = TimescaleModes.Scaled, bool stop = false, bool restore = false)
public virtual void OnMMCinemachineRotationShakeEvent(AnimationCurve shakeCurve, float duration, Vector3 rotationAmplitude, float remapMin, float remapMax, bool relative, float feedbacksIntensity = 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)) return;
@@ -179,13 +179,13 @@ namespace MoreMountains.FeedbacksForThirdParty
public override void StartListening()
{
base.StartListening();
MMCameraRotationShakeEvent.Register(OnMMCameraRotationShakeEvent);
MMCinemachineRotationShakeEvent.Register(OnMMCinemachineRotationShakeEvent);
}
public override void StopListening()
{
base.StopListening();
MMCameraRotationShakeEvent.Unregister(OnMMCameraRotationShakeEvent);
MMCinemachineRotationShakeEvent.Unregister(OnMMCinemachineRotationShakeEvent);
}
}
}

View File

@@ -16068,7 +16068,6 @@ MonoBehaviour:
- {fileID: 1863583934}
- {fileID: 84412559}
- {fileID: 511410322}
- {fileID: 2089621863}
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
@@ -16194,8 +16193,8 @@ MonoBehaviour:
Entry: 7
Data: 6|SLSFramework.FeelAssistance.FeedbackUnit, Assembly-CSharp
- Name: feedback
Entry: 10
Data: 4
Entry: 6
Data:
- Name: action
Entry: 6
Data:
@@ -20475,7 +20474,7 @@ MeshCollider:
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1328013964 stripped
@@ -28552,7 +28551,6 @@ MonoBehaviour:
InScriptDrivenPause: 0
FeedbacksList:
- rid: 5266334308210049401
- rid: 5266334821235818644
KeepPlayModeChanges: 0
PerformanceMode: 0
RestoreInitialValuesOnDisable: 0
@@ -28705,144 +28703,6 @@ MonoBehaviour:
Velocity: {x: 0, y: 0, z: 0}
ClearImpulseOnStop: 0
DrawGizmos: 0
- rid: 5266334821235818644
type: {class: MMF_CameraRotation, ns: MoreMountains.Feedbacks, asm: MoreMountains.Tools}
data:
Active: 0
UniqueID: 1267823441
Label: Camera Rotation Shake
OriginalLabel: Camera Rotation Shake
ChannelMode: 0
Channel: 0
MMChannelDefinition: {fileID: 0}
Chance: 100
Timing:
TimescaleMode: 0
ExcludeFromHoldingPauses: 0
ContributeToTotalDuration: 1
InitialDelay: 0
CooldownDuration: 0
InterruptsOnStop: 1
NumberOfRepeats: 0
RepeatForever: 0
DelayBetweenRepeats: 1
PlayCount: 0
LimitPlayCount: 0
MaxPlayCount: 3
SetPlayCountToZeroOnReset: 0
MMFeedbacksDirectionCondition: 0
PlayDirection: 0
ConstantIntensity: 0
UseIntensityInterval: 0
IntensityIntervalMin: 0
IntensityIntervalMax: 0
Sequence: {fileID: 0}
TrackID: 0
Quantized: 0
TargetBPM: 120
AutomatedTargetAcquisition:
Mode: 0
ChildIndex: 0
RandomizeOutput: 0
RandomMultiplier: {x: 0.8, y: 1}
RandomizeDuration: 0
RandomDurationMultiplier: {x: 0.5, y: 2}
UseRange: 0
RangeDistance: 5
UseRangeFalloff: 0
RangeFalloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
RemapRangeFalloff: {x: 0, y: 1}
AutomaticShakerSetupButton:
ButtonText: Automatic Shaker Setup
Owner: {fileID: 1863583934}
DebugActive: 0
Duration: 0.3
RotationAmplitude: {x: 0, y: 10, z: 5}
ShakeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.2
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
UseAttenuation: 0
AttenuationRange: 50
AttenuationCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
ResetShakerValuesAfterShake: 1
ResetTargetValuesAfterShake: 1
DrawGizmos: 1
--- !u!1 &1864005839 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5712394601613459224, guid: d22a44843d244fc4fb4459be68ead0bb, type: 3}
@@ -33930,7 +33790,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2089621861}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6da43522623d4704e979466dc7650b65, type: 3}
m_Name:
@@ -34026,22 +33886,98 @@ MonoBehaviour:
DebugActive: 0
InScriptDrivenPause: 0
FeedbacksList:
- rid: 5266334308210049411
- rid: 563130611402277196
- rid: 563130666638376960
- rid: 563130666638377074
- rid: 563130666638377075
- rid: 563130666638377076
KeepPlayModeChanges: 0
PerformanceMode: 0
RestoreInitialValuesOnDisable: 0
StopFeedbacksOnDisable: 0
PlayCount: 59
PlayCount: 0
references:
version: 2
RefIds:
- rid: 563130611402277196
- rid: 563130666638377074
type: {class: MMF_FreezeFrame, ns: MoreMountains.Feedbacks, asm: MoreMountains.Tools}
data:
Active: 0
UniqueID: -1269842796
Label: Freeze Frame
OriginalLabel: Freeze Frame
ChannelMode: 0
Channel: 0
MMChannelDefinition: {fileID: 0}
Chance: 100
Timing:
TimescaleMode: 0
ExcludeFromHoldingPauses: 0
ContributeToTotalDuration: 1
InitialDelay: 0
CooldownDuration: 0
InterruptsOnStop: 1
NumberOfRepeats: 0
RepeatForever: 0
DelayBetweenRepeats: 1
PlayCount: 59
LimitPlayCount: 0
MaxPlayCount: 3
SetPlayCountToZeroOnReset: 0
MMFeedbacksDirectionCondition: 0
PlayDirection: 0
ConstantIntensity: 0
UseIntensityInterval: 0
IntensityIntervalMin: 0
IntensityIntervalMax: 0
Sequence: {fileID: 0}
TrackID: 0
Quantized: 0
TargetBPM: 120
AutomatedTargetAcquisition:
Mode: 0
ChildIndex: 0
RandomizeOutput: 0
RandomMultiplier: {x: 0.8, y: 1}
RandomizeDuration: 0
RandomDurationMultiplier: {x: 0.5, y: 2}
UseRange: 0
RangeDistance: 5
UseRangeFalloff: 0
RangeFalloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
RemapRangeFalloff: {x: 0, y: 1}
AutomaticShakerSetupButton:
ButtonText: Automatic Shaker Setup
Owner: {fileID: 2089621863}
DebugActive: 0
FreezeFrameDuration: 0.06
MinimumTimescaleThreshold: 0.1
- rid: 563130666638377075
type: {class: MMF_CinemachineImpulse, ns: MoreMountains.FeedbacksForThirdParty, asm: MoreMountains.Tools}
data:
Active: 1
UniqueID: 2061972629
UniqueID: -1491924810
Label: Cinemachine Impulse
OriginalLabel: Cinemachine Impulse
ChannelMode: 0
@@ -34178,16 +34114,16 @@ MonoBehaviour:
DissipationMode: 2
DissipationDistance: 100
PropagationSpeed: 343
Velocity: {x: 0, y: 0.2, z: 0}
Velocity: {x: 5, y: 5, z: 5}
ClearImpulseOnStop: 0
DrawGizmos: 0
- rid: 563130666638376960
type: {class: MMF_CameraRotation, ns: MoreMountains.Feedbacks, asm: MoreMountains.Tools}
- rid: 563130666638377076
type: {class: MMF_CinemachineRotation, ns: MoreMountains.Feedbacks, asm: MoreMountains.Tools}
data:
Active: 1
UniqueID: -1751621655
Label: Camera Rotation Shake
OriginalLabel: Camera Rotation Shake
UniqueID: -1149022277
Label: Cinemachine Rotation Shake
OriginalLabel: Cinemachine Rotation Shake
ChannelMode: 0
Channel: 0
MMChannelDefinition: {fileID: 0}
@@ -34255,8 +34191,8 @@ MonoBehaviour:
ButtonText: Automatic Shaker Setup
Owner: {fileID: 2089621863}
DebugActive: 0
Duration: 0.6
RotationAmplitude: {x: -2, y: 0, z: -5}
Duration: 0.4
RotationAmplitude: {x: 2, y: 0, z: -5}
ShakeCurve:
serializedVersion: 2
m_Curve:
@@ -34319,82 +34255,6 @@ MonoBehaviour:
ResetShakerValuesAfterShake: 1
ResetTargetValuesAfterShake: 1
DrawGizmos: 1
- rid: 5266334308210049411
type: {class: MMF_FreezeFrame, ns: MoreMountains.Feedbacks, asm: MoreMountains.Tools}
data:
Active: 0
UniqueID: 338322809
Label: Freeze Frame
OriginalLabel: Freeze Frame
ChannelMode: 0
Channel: 0
MMChannelDefinition: {fileID: 0}
Chance: 100
Timing:
TimescaleMode: 0
ExcludeFromHoldingPauses: 0
ContributeToTotalDuration: 1
InitialDelay: 0
CooldownDuration: 0
InterruptsOnStop: 1
NumberOfRepeats: 0
RepeatForever: 0
DelayBetweenRepeats: 1
PlayCount: 59
LimitPlayCount: 0
MaxPlayCount: 3
SetPlayCountToZeroOnReset: 0
MMFeedbacksDirectionCondition: 0
PlayDirection: 0
ConstantIntensity: 0
UseIntensityInterval: 0
IntensityIntervalMin: 0
IntensityIntervalMax: 0
Sequence: {fileID: 0}
TrackID: 0
Quantized: 0
TargetBPM: 120
AutomatedTargetAcquisition:
Mode: 0
ChildIndex: 0
RandomizeOutput: 0
RandomMultiplier: {x: 0.8, y: 1}
RandomizeDuration: 0
RandomDurationMultiplier: {x: 0.5, y: 2}
UseRange: 0
RangeDistance: 5
UseRangeFalloff: 0
RangeFalloff:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
RemapRangeFalloff: {x: 0, y: 1}
AutomaticShakerSetupButton:
ButtonText: Automatic Shaker Setup
Owner: {fileID: 2089621863}
DebugActive: 0
FreezeFrameDuration: 0.06
MinimumTimescaleThreshold: 0.1
--- !u!4 &2089966422 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5775646025416913786, guid: bb895333a2c297046982a7e19d1b2f95, type: 3}

View File

@@ -9,7 +9,7 @@ namespace SLSFramework.Rendering.PostProcessing
public class SpeedLines : ScriptablePostProcessorVolume
{
public override CustomPostProcessInjectionPoint InjectionPoint => CustomPostProcessInjectionPoint.AfterPostProcess;
public override int OrderInInjectionPoint => 20; // 调整执行顺序
public override int OrderInInjectionPoint => 20;
[Header("Effect Color & Intensity")]
public ColorParameter color = new(new Color(1f, 1f, 1f, 0.5f), true, true, true);