mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 17:26:03 +08:00
Fixed crash happening when the number of Sequences exceeded by far the number of Tweeners
This commit is contained in:
parent
85862b7fc5
commit
79c6148734
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
using TMPro;
|
||||
|
||||
public class ExternalPlugins_TextMeshPro : BrainBase
|
||||
{
|
||||
public TextMeshPro[] texts;
|
||||
|
||||
const string ReplaceText = "This text is gonna appear with a tween, yabadabadoo!";
|
||||
|
||||
void Start()
|
||||
{
|
||||
DOTween.Init();
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
GUILayout.Label("These tweens won't stack. Run one at a time");
|
||||
if (GUILayout.Button("Color To Green")) foreach (TextMeshPro t in texts) t.DOColor(Color.green, 1).SetEase(Ease.Linear);
|
||||
if (GUILayout.Button("Color To Red")) foreach (TextMeshPro t in texts) t.DOColor(Color.red, 1).SetEase(Ease.Linear);
|
||||
if (GUILayout.Button("Fade Out")) foreach (TextMeshPro t in texts) t.DOFade(0, 1).SetEase(Ease.Linear);
|
||||
if (GUILayout.Button("Fade In")) foreach (TextMeshPro t in texts) t.DOFade(1, 1).SetEase(Ease.Linear);
|
||||
if (GUILayout.Button("Font Resize Down")) foreach (TextMeshPro t in texts) t.DOFontSize(10, 1);
|
||||
if (GUILayout.Button("Font Resize Up")) foreach (TextMeshPro t in texts) t.DOFontSize(32, 1);
|
||||
if (GUILayout.Button("Trim Max Visible Characters")) foreach (TextMeshPro t in texts) t.DOMaxVisibleCharacters(22, 1);
|
||||
if (GUILayout.Button("Text Replace")) foreach (TextMeshPro t in texts) t.DOText(ReplaceText, 2).SetEase(Ease.Linear);
|
||||
if (GUILayout.Button("Text Replace W Scramble")) foreach (TextMeshPro t in texts) t.DOText(ReplaceText, 2, true).SetEase(Ease.Linear);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9c491e5065317f41beb06aaac4b042f
|
||||
timeCreated: 1427479531
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1341851c621e954d88d72d42fca5db9
|
||||
timeCreated: 1427479446
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -11,12 +11,15 @@ public class Temp : BrainBase
|
||||
{
|
||||
yield return new WaitForSeconds(0.6f);
|
||||
|
||||
Sequence s0 = DOTween.Sequence().Append(target.DOMoveX(3, 2)).OnComplete(()=> Debug.Log("s0 complete"));
|
||||
Sequence s1 = DOTween.Sequence().Append(target.DOMoveY(3, 2)).OnComplete(()=> Debug.Log("s1 complete"));
|
||||
Sequence s = DOTween.Sequence().Append(s0).Append(s1).OnComplete(()=> Debug.Log("MAIN COMPLETE"));
|
||||
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
s.Complete();
|
||||
while (true) {
|
||||
if (Time.frameCount % 10 == 0) {
|
||||
// Spawn empty sequences
|
||||
for (int i = 0; i < 200; ++i) {
|
||||
Sequence s = DOTween.Sequence();
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -828,7 +828,7 @@ namespace DG.Tweening.Core
|
||||
Array.Resize(ref _pooledTweeners, maxTweeners);
|
||||
break;
|
||||
}
|
||||
maxActive = maxTweeners;
|
||||
maxActive = Mathf.Max(maxTweeners, maxSequences);
|
||||
Array.Resize(ref _activeTweens, maxActive);
|
||||
if (killAdd > 0) _KillList.Capacity += killAdd;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.401";
|
||||
public static readonly string Version = "1.0.405";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
Binary file not shown.
Binary file not shown.
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