mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
Added DOTween.useSmoothDeltaTime option, and relative setting in the Utility Panel Preferences
This commit is contained in:
parent
f8a483d91d
commit
f73c8454a0
@ -1500,6 +1500,12 @@
|
||||
<summary>Global DOTween timeScale.
|
||||
<para>Default: 1</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.useSmoothDeltaTime">
|
||||
<summary>If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
|
||||
(unless they're set as timeScaleIndependent, in which case this setting will be ignored).
|
||||
Setting this to TRUE will lead to smoother animations.
|
||||
<para>Default: FALSE</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.drawGizmos">
|
||||
<summary>If TRUE draws path gizmos in Unity Editor (if the gizmos button is active).
|
||||
Deactivate this if you want to avoid gizmos overhead while in Unity Editor</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1500,6 +1500,12 @@
|
||||
<summary>Global DOTween timeScale.
|
||||
<para>Default: 1</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.useSmoothDeltaTime">
|
||||
<summary>If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
|
||||
(unless they're set as timeScaleIndependent, in which case this setting will be ignored).
|
||||
Setting this to TRUE will lead to smoother animations.
|
||||
<para>Default: FALSE</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.drawGizmos">
|
||||
<summary>If TRUE draws path gizmos in Unity Editor (if the gizmos button is active).
|
||||
Deactivate this if you want to avoid gizmos overhead while in Unity Editor</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1500,6 +1500,12 @@
|
||||
<summary>Global DOTween timeScale.
|
||||
<para>Default: 1</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.useSmoothDeltaTime">
|
||||
<summary>If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
|
||||
(unless they're set as timeScaleIndependent, in which case this setting will be ignored).
|
||||
Setting this to TRUE will lead to smoother animations.
|
||||
<para>Default: FALSE</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.drawGizmos">
|
||||
<summary>If TRUE draws path gizmos in Unity Editor (if the gizmos button is active).
|
||||
Deactivate this if you want to avoid gizmos overhead while in Unity Editor</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -47,7 +47,7 @@ namespace DG.Tweening.Core
|
||||
{
|
||||
_unscaledDeltaTime = Time.realtimeSinceStartup - _unscaledTime;
|
||||
if (TweenManager.hasActiveDefaultTweens) {
|
||||
TweenManager.Update(UpdateType.Normal, Time.deltaTime * DOTween.timeScale, _unscaledDeltaTime * DOTween.timeScale);
|
||||
TweenManager.Update(UpdateType.Normal, (DOTween.useSmoothDeltaTime ? Time.smoothDeltaTime : Time.deltaTime) * DOTween.timeScale, _unscaledDeltaTime * DOTween.timeScale);
|
||||
}
|
||||
_unscaledTime = Time.realtimeSinceStartup;
|
||||
|
||||
@ -63,14 +63,14 @@ namespace DG.Tweening.Core
|
||||
void LateUpdate()
|
||||
{
|
||||
if (TweenManager.hasActiveLateTweens) {
|
||||
TweenManager.Update(UpdateType.Late, Time.deltaTime * DOTween.timeScale, _unscaledDeltaTime * DOTween.timeScale);
|
||||
TweenManager.Update(UpdateType.Late, (DOTween.useSmoothDeltaTime ? Time.smoothDeltaTime : Time.deltaTime) * DOTween.timeScale, _unscaledDeltaTime * DOTween.timeScale);
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (TweenManager.hasActiveFixedTweens && Time.timeScale > 0) {
|
||||
TweenManager.Update(UpdateType.Fixed, Time.deltaTime * DOTween.timeScale, (Time.deltaTime / Time.timeScale) * DOTween.timeScale);
|
||||
TweenManager.Update(UpdateType.Fixed, (DOTween.useSmoothDeltaTime ? Time.smoothDeltaTime : Time.deltaTime) * DOTween.timeScale, ((DOTween.useSmoothDeltaTime ? Time.smoothDeltaTime : Time.deltaTime) / Time.timeScale) * DOTween.timeScale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@ namespace DG.Tweening.Core
|
||||
public const string AssetName = "DOTweenSettings";
|
||||
|
||||
public bool useSafeMode = true;
|
||||
public float timeScale = 1;
|
||||
public bool useSmoothDeltaTime;
|
||||
public bool showUnityEditorReport;
|
||||
public LogBehaviour logBehaviour = LogBehaviour.ErrorsOnly;
|
||||
public bool drawGizmos = true;
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.755";
|
||||
public static readonly string Version = "1.0.765";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
@ -49,6 +49,11 @@ namespace DG.Tweening
|
||||
/// <summary>Global DOTween timeScale.
|
||||
/// <para>Default: 1</para></summary>
|
||||
public static float timeScale = 1;
|
||||
/// <summary>If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
|
||||
/// (unless they're set as timeScaleIndependent, in which case this setting will be ignored).
|
||||
/// Setting this to TRUE will lead to smoother animations.
|
||||
/// <para>Default: FALSE</para></summary>
|
||||
public static bool useSmoothDeltaTime;
|
||||
/// <summary>DOTween's log behaviour.
|
||||
/// <para>Default: LogBehaviour.ErrorsOnly</para></summary>
|
||||
public static LogBehaviour logBehaviour {
|
||||
@ -167,6 +172,8 @@ namespace DG.Tweening
|
||||
if (useSafeMode == null) DOTween.useSafeMode = settings.useSafeMode;
|
||||
if (logBehaviour == null) DOTween.logBehaviour = settings.logBehaviour;
|
||||
if (recycleAllByDefault == null) DOTween.defaultRecyclable = settings.defaultRecyclable;
|
||||
DOTween.timeScale = settings.timeScale;
|
||||
DOTween.useSmoothDeltaTime = settings.useSmoothDeltaTime;
|
||||
DOTween.defaultRecyclable = recycleAllByDefault == null ? settings.defaultRecyclable : (bool)recycleAllByDefault;
|
||||
DOTween.showUnityEditorReport = settings.showUnityEditorReport;
|
||||
DOTween.drawGizmos = settings.drawGizmos;
|
||||
@ -219,6 +226,7 @@ namespace DG.Tweening
|
||||
showUnityEditorReport = false;
|
||||
drawGizmos = true;
|
||||
timeScale = 1;
|
||||
useSmoothDeltaTime = false;
|
||||
logBehaviour = LogBehaviour.ErrorsOnly;
|
||||
defaultEaseType = Ease.OutQuad;
|
||||
defaultEaseOvershootOrAmplitude = 1.70158f;
|
||||
|
||||
@ -45,7 +45,7 @@ namespace DG.DOTweenEditor
|
||||
static void ShowWindow() { Open(); }
|
||||
|
||||
const string _Title = "DOTween Utility Panel";
|
||||
static readonly Vector2 _WinSize = new Vector2(300,365);
|
||||
static readonly Vector2 _WinSize = new Vector2(300,405);
|
||||
public const string Id = "DOTweenVersion";
|
||||
public const string IdPro = "DOTweenProVersion";
|
||||
static readonly float _HalfBtSize = _WinSize.x * 0.5f - 6;
|
||||
@ -170,6 +170,8 @@ namespace DG.DOTweenEditor
|
||||
// Reset to original defaults
|
||||
_src.useSafeMode = true;
|
||||
_src.showUnityEditorReport = false;
|
||||
_src.timeScale = 1;
|
||||
_src.useSmoothDeltaTime = false;
|
||||
_src.logBehaviour = LogBehaviour.ErrorsOnly;
|
||||
_src.drawGizmos = true;
|
||||
_src.defaultRecyclable = false;
|
||||
@ -185,6 +187,8 @@ namespace DG.DOTweenEditor
|
||||
}
|
||||
GUILayout.Space(8);
|
||||
_src.useSafeMode = EditorGUILayout.Toggle("Safe Mode", _src.useSafeMode);
|
||||
_src.timeScale = EditorGUILayout.FloatField("DOTween's TimeScale", _src.timeScale);
|
||||
_src.useSmoothDeltaTime = EditorGUILayout.Toggle("Smooth DeltaTime", _src.useSmoothDeltaTime);
|
||||
_src.showUnityEditorReport = EditorGUILayout.Toggle("Editor Report", _src.showUnityEditorReport);
|
||||
_src.logBehaviour = (LogBehaviour)EditorGUILayout.EnumPopup("Log Behaviour", _src.logBehaviour);
|
||||
_src.drawGizmos = EditorGUILayout.Toggle("Draw Path Gizmos", _src.drawGizmos);
|
||||
|
||||
@ -1500,6 +1500,12 @@
|
||||
<summary>Global DOTween timeScale.
|
||||
<para>Default: 1</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.useSmoothDeltaTime">
|
||||
<summary>If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens
|
||||
(unless they're set as timeScaleIndependent, in which case this setting will be ignored).
|
||||
Setting this to TRUE will lead to smoother animations.
|
||||
<para>Default: FALSE</para></summary>
|
||||
</member>
|
||||
<member name="F:DG.Tweening.DOTween.drawGizmos">
|
||||
<summary>If TRUE draws path gizmos in Unity Editor (if the gizmos button is active).
|
||||
Deactivate this if you want to avoid gizmos overhead while in Unity Editor</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user