调整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);
}
}
}