diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll
index 3d736a3..d5f9ddb 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb
index 87e3c47..0565534 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
index be2b674..92ab578 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
@@ -12,9 +12,9 @@
- Stops the update loop and clears any callback.
+ Stops the update loop and clears the onPreviewUpdated callback.
- If TRUE also resets the tweened objects to their original state
+ If TRUE also resets the tweened objects to their original state
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll
index 0121a3e..637ac83 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb
index c51dee3..cc76101 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll
index 180ba74..ef7738b 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb
index 39c82cf..34c3c36 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb differ
diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs
index bf0b1d2..521ee7f 100644
--- a/_DOTween.Assembly/DOTween/DOTween.cs
+++ b/_DOTween.Assembly/DOTween/DOTween.cs
@@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// DOTween's version
- public static readonly string Version = "1.2.140"; // Last version before modules: 1.1.755
+ public static readonly string Version = "1.2.145"; // Last version before modules: 1.1.755
///////////////////////////////////////////////
// Options ////////////////////////////////////
diff --git a/_DOTween.Assembly/DOTweenEditor/DOTweenEditorPreview.cs b/_DOTween.Assembly/DOTweenEditor/DOTweenEditorPreview.cs
index 02d43db..76bec19 100644
--- a/_DOTween.Assembly/DOTweenEditor/DOTweenEditorPreview.cs
+++ b/_DOTween.Assembly/DOTweenEditor/DOTweenEditorPreview.cs
@@ -18,11 +18,11 @@ namespace DG.DOTweenEditor
static double _previewTime;
static Action _onPreviewUpdated;
static GameObject _previewObj; // Used so it can be set dirty (otherwise canvas-only tweens won't refresh the view)
- static readonly List _tweens = new List();
+ static readonly List _Tweens = new List();
static DOTweenEditorPreview()
{
- Clear();
+ ClearPreviewObject();
}
#region Public Methods
@@ -43,27 +43,26 @@ namespace DG.DOTweenEditor
}
///
- /// Stops the update loop and clears any callback.
+ /// Stops the update loop and clears the onPreviewUpdated callback.
///
- /// If TRUE also resets the tweened objects to their original state
- public static void Stop(bool reset = false)
+ /// If TRUE also resets the tweened objects to their original state
+ public static void Stop(bool resetTweenTargets = false)
{
_isPreviewing = false;
EditorApplication.update -= PreviewUpdate;
_onPreviewUpdated = null;
- if (reset) {
- foreach (Tween t in _tweens) {
- if (t != null && t.active) {
- try {
- if (t.isFrom) t.Complete();
- else t.Rewind();
- } catch {
- // Just skip
- }
+ if (resetTweenTargets) {
+ foreach (Tween t in _Tweens) {
+ try {
+ if (t.isFrom) t.Complete();
+ else t.Rewind();
+ } catch {
+ // Ignore
}
}
}
- Clear();
+ ValidateTweens();
+ ClearPreviewObject();
}
///
@@ -75,7 +74,7 @@ namespace DG.DOTweenEditor
/// If TRUE starts playing the tween immediately
public static void PrepareTweenForPreview(Tween t, bool clearCallbacks = true, bool preventAutoKill = true, bool andPlay = true)
{
- _tweens.Add(t);
+ _Tweens.Add(t);
t.SetUpdate(UpdateType.Manual);
if (preventAutoKill) t.SetAutoKill(false);
if (clearCallbacks) {
@@ -90,10 +89,9 @@ namespace DG.DOTweenEditor
#region Methods
- static void Clear()
+ static void ClearPreviewObject()
{
_previewObj = null;
- _tweens.Clear();
// Find and destroy any existing preview objects
PreviewComponent[] objs = Object.FindObjectsOfType();
for (int i = 0; i < objs.Length; ++i) Object.DestroyImmediate(objs[i].gameObject);
@@ -111,6 +109,13 @@ namespace DG.DOTweenEditor
if (_onPreviewUpdated != null) _onPreviewUpdated();
}
+ static void ValidateTweens()
+ {
+ for (int i = _Tweens.Count - 1; i > -1; --i) {
+ if (_Tweens[i] == null || !_Tweens[i].active) _Tweens.RemoveAt(i);
+ }
+ }
+
#endregion
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll
index 3d736a3..d5f9ddb 100644
Binary files a/_DOTween.Assembly/bin/DOTween.dll and b/_DOTween.Assembly/bin/DOTween.dll differ
diff --git a/_DOTween.Assembly/bin/DOTween.dll.mdb b/_DOTween.Assembly/bin/DOTween.dll.mdb
index 87e3c47..0565534 100644
Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML b/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
index be2b674..92ab578 100644
--- a/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
+++ b/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
@@ -12,9 +12,9 @@
- Stops the update loop and clears any callback.
+ Stops the update loop and clears the onPreviewUpdated callback.
- If TRUE also resets the tweened objects to their original state
+ If TRUE also resets the tweened objects to their original state
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll
index 0121a3e..637ac83 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb
index c51dee3..cc76101 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll
index 180ba74..ef7738b 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb
index 39c82cf..34c3c36 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb differ