Feel滚
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace SLSUtilities.Feedback
|
||||
{
|
||||
/// <summary>
|
||||
@@ -32,4 +34,33 @@ namespace SLSUtilities.Feedback
|
||||
/// </summary>
|
||||
float GetTimeScale(FeedbackTimeSettings settings);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认时间提供者。当没有指定 IFeedbackTimeProvider 时使用,
|
||||
/// 返回 unscaledDeltaTime 并且不受任何自定义时间缩放影响。
|
||||
/// </summary>
|
||||
public class DefaultFeedbackTimeProvider : IFeedbackTimeProvider
|
||||
{
|
||||
public float GlobalTimeScale => 1f;
|
||||
public float GroupTimeScale => 1f;
|
||||
public float LocalTimeScale => 1f;
|
||||
|
||||
public static readonly DefaultFeedbackTimeProvider Instance = new DefaultFeedbackTimeProvider();
|
||||
|
||||
/// <summary>
|
||||
/// 返回固定时间缩放 1。
|
||||
/// </summary>
|
||||
public float GetTimeScale(FeedbackTimeSettings settings)
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回 unscaledDeltaTime,不受任何自定义时间缩放影响。
|
||||
/// </summary>
|
||||
public float GetDeltaTime(FeedbackTimeSettings settings)
|
||||
{
|
||||
return Time.deltaTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user