1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00

Fixed tweens not working correctly if Fixed UpdateType was set as default from DOTween's Utility Panel

This commit is contained in:
Daniele Giardini 2015-06-09 20:10:27 +02:00
parent 5c9a7e4fd3
commit c6d84ccfda
15 changed files with 17 additions and 28 deletions

View File

@ -9,33 +9,13 @@ using UnityEngine.UI;
public class TempTests : MonoBehaviour public class TempTests : MonoBehaviour
{ {
public Transform t; public bool straightFixedUpdate;
Sequence sequence;
void Start() IEnumerator Start()
{ {
sequence = DOTween.Sequence(); yield return new WaitForSeconds(1);
sequence.AppendInterval(3);
sequence.AppendCallback(() => {
this.transform.GetComponent<MeshRenderer>().enabled = !this.transform.GetComponent<MeshRenderer>().enabled;
});
sequence.OnStart(MyCallback); Tween t = transform.DORotate(new Vector3(0, 180, 0), 2).OnComplete(()=> Debug.Log("Complete"));
if (straightFixedUpdate) t.SetUpdate(UpdateType.Fixed);
sequence.SetLoops(-1, LoopType.Restart);
sequence.Play();
}
void OnDestroy()
{
if (sequence != null) {
Debug.Log("Killing Sequence");
sequence.Kill();
}
}
void MyCallback()
{
t.position = Vector3.zero;
} }
} }

View File

@ -755,8 +755,17 @@ namespace DG.Tweening.Core
t.isIndependentUpdate = DOTween.defaultTimeScaleIndependent; t.isIndependentUpdate = DOTween.defaultTimeScaleIndependent;
t.activeId = _maxActiveLookupId = totActiveTweens; t.activeId = _maxActiveLookupId = totActiveTweens;
_activeTweens[totActiveTweens] = t; _activeTweens[totActiveTweens] = t;
hasActiveDefaultTweens = true; if (t.updateType == UpdateType.Normal) {
totActiveDefaultTweens++; totActiveDefaultTweens++;
hasActiveDefaultTweens = true;
} else if (t.updateType == UpdateType.Fixed) {
totActiveFixedTweens++;
hasActiveFixedTweens = true;
} else {
totActiveLateTweens++;
hasActiveLateTweens = true;
}
totActiveTweens++; totActiveTweens++;
if (t.tweenType == TweenType.Tweener) totActiveTweeners++; if (t.tweenType == TweenType.Tweener) totActiveTweeners++;
else totActiveSequences++; else totActiveSequences++;

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.0.780"; public static readonly string Version = "1.0.785";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

Binary file not shown.