狗屎Minimax坏我代码
This commit is contained in:
@@ -235,8 +235,12 @@ namespace Cielonos.MainGame.Characters
|
||||
public virtual void PlayGetHitAnimation(string funcAnimName, out float animDuration,
|
||||
Vector3 direction = default)
|
||||
{
|
||||
fullBodyFuncAnimSm.Play(funcAnimName);
|
||||
animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.ActionDisruption).StartTime;
|
||||
if (fullBodyFuncAnimSm.Play(funcAnimName))
|
||||
{
|
||||
animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.ActionDisruption).StartTime;
|
||||
}
|
||||
|
||||
animDuration = 0.2f;
|
||||
//animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.Active).EndTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,23 @@ namespace Cielonos.MainGame.Characters
|
||||
_timeProvider = new CharacterFeedbackTimeProvider(owner);
|
||||
}
|
||||
}
|
||||
|
||||
public FeedbackData GetFeedbackData(string feedbackName)
|
||||
{
|
||||
if (feedbackDataCollection == null)
|
||||
{
|
||||
Debug.LogWarning($"[Item.FeedbackSubcontroller] feedbackDataCollection is null on {owner?.name}.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!feedbackDataCollection.TryGet(feedbackName, out FeedbackData data))
|
||||
{
|
||||
Debug.LogWarning($"[Item.FeedbackSubcontroller] FeedbackData '{feedbackName}' not found on {owner?.name}.");
|
||||
return null;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过新系统播放一个 FeedbackData。
|
||||
@@ -109,7 +126,7 @@ namespace Cielonos.MainGame.Characters
|
||||
}
|
||||
|
||||
// 新系统驱动
|
||||
float dt = Time.unscaledDeltaTime;
|
||||
float dt = Time.deltaTime;
|
||||
for (int i = _activePlayers.Count - 1; i >= 0; i--)
|
||||
{
|
||||
FeedbackPlayer player = _activePlayers[i];
|
||||
@@ -122,30 +139,4 @@ namespace Cielonos.MainGame.Characters
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class FeedbackSubcontroller
|
||||
{
|
||||
protected void Swing(Vector3 swingRotation, float rotationDuration, Vector3 swingPosition, float positionDuration)
|
||||
{
|
||||
MMF_Player swing = LeanPool.Spawn(MainGameBaseCollection.Instance.feedbackCollection["Swing"]).GetComponent<MMF_Player>();
|
||||
|
||||
MMF_CinemachineRotation cinemachineRotation = swing.GetFeedbackOfType<MMF_CinemachineRotation>();
|
||||
if (cinemachineRotation != null)
|
||||
{
|
||||
cinemachineRotation.RotationAmplitude = swingRotation != default ? swingRotation : Vector3.zero;
|
||||
cinemachineRotation.Duration = rotationDuration;
|
||||
}
|
||||
|
||||
MMF_CinemachinePosition cinemachinePosition = swing.GetFeedbackOfType<MMF_CinemachinePosition>();
|
||||
if (cinemachinePosition != null)
|
||||
{
|
||||
cinemachinePosition.PositionAmplitude = swingPosition != default ? swingPosition : Vector3.zero;
|
||||
cinemachinePosition.Duration = positionDuration;
|
||||
}
|
||||
|
||||
swing.Events.OnComplete.RemoveAllListeners();
|
||||
swing.Events.OnComplete.AddListener(()=> LeanPool.Despawn(swing.gameObject));
|
||||
swing.PlayFeedbacks();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,8 +143,9 @@ namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
defaultDodge.onPerfectDodge = () =>
|
||||
{
|
||||
player.feedbackSc["PerfectDodge"].feedback.GetFeedbackOfType<MMF_RadialBlur>().TargetCenter = player.GetNormalizedScreenPosition();
|
||||
player.feedbackSc["PerfectDodge"].feedback.GetFeedbackOfType<MMF_AdvancedVignette>().Center = player.GetNormalizedScreenPosition();
|
||||
// Perfect Dodge 反馈将在 PlayerFeedbackSubcontroller 中统一处理
|
||||
// 这里可以添加任何 Perfect Dodge 特有的回调逻辑
|
||||
// 例如:记录完美闪避次数、触发成就等
|
||||
};
|
||||
}
|
||||
return defaultDodge;
|
||||
|
||||
Reference in New Issue
Block a user