狗屎Minimax坏我代码
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user