1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 01:36:05 +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 Transform t;
Sequence sequence;
public bool straightFixedUpdate;
void Start()
IEnumerator Start()
{
sequence = DOTween.Sequence();
sequence.AppendInterval(3);
sequence.AppendCallback(() => {
this.transform.GetComponent<MeshRenderer>().enabled = !this.transform.GetComponent<MeshRenderer>().enabled;
});
yield return new WaitForSeconds(1);
sequence.OnStart(MyCallback);
sequence.SetLoops(-1, LoopType.Restart);
sequence.Play();
Tween t = transform.DORotate(new Vector3(0, 180, 0), 2).OnComplete(()=> Debug.Log("Complete"));
if (straightFixedUpdate) t.SetUpdate(UpdateType.Fixed);
}
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.activeId = _maxActiveLookupId = totActiveTweens;
_activeTweens[totActiveTweens] = t;
hasActiveDefaultTweens = true;
totActiveDefaultTweens++;
if (t.updateType == UpdateType.Normal) {
totActiveDefaultTweens++;
hasActiveDefaultTweens = true;
} else if (t.updateType == UpdateType.Fixed) {
totActiveFixedTweens++;
hasActiveFixedTweens = true;
} else {
totActiveLateTweens++;
hasActiveLateTweens = true;
}
totActiveTweens++;
if (t.tweenType == TweenType.Tweener) totActiveTweeners++;
else totActiveSequences++;

View File

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

Binary file not shown.