mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-14 02:58:46 +08:00
Fixed issue with TweensById returning a NullReferenceException in some cases
This commit is contained in:
parent
04e3b085fa
commit
b5d1cc8853
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.
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,33 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
|
||||
public class PortraitToLandscapeAtRuntime : BrainBase
|
||||
{
|
||||
public RectTransform target;
|
||||
Tween tween;
|
||||
|
||||
void Start()
|
||||
{
|
||||
CreateRTTween();
|
||||
tween.Pause();
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
if (GUILayout.Button("Rewind")) DOTween.RewindAll();
|
||||
if (GUILayout.Button("Restart")) tween.Restart();
|
||||
if (GUILayout.Button("RT Recreate")) CreateRTTween();
|
||||
if (GUILayout.Button("T Recreate")) CreateTween();
|
||||
}
|
||||
|
||||
void CreateRTTween()
|
||||
{
|
||||
tween = target.DOAnchorPos(new Vector2(0, 50), 2).SetRelative().SetAutoKill(false);
|
||||
}
|
||||
|
||||
void CreateTween()
|
||||
{
|
||||
tween = ((Transform)target).DOMove(new Vector2(0, 50), 2).SetRelative().SetAutoKill(false);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ef197472500d8440ad7fad75d61a282
|
||||
timeCreated: 1429640495
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46ec2e75aee41d44c9d45f8fed38b280
|
||||
timeCreated: 1429640488
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -687,7 +687,7 @@ namespace DG.Tweening.Core
|
||||
List<Tween> ts = new List<Tween>(len);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Tween t = _activeTweens[i];
|
||||
if (t.id.Equals(id)) ts.Add(t);
|
||||
if (t != null && Equals(id, t.id)) ts.Add(t);
|
||||
}
|
||||
if (ts.Count > 0) return ts;
|
||||
return null;
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.605";
|
||||
public static readonly string Version = "1.0.606";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
@ -843,6 +843,8 @@ namespace DG.Tweening
|
||||
/// </summary>
|
||||
public static List<Tween> TweensById(object id)
|
||||
{
|
||||
if (id == null) return null;
|
||||
|
||||
return TweenManager.GetTweensById(id);
|
||||
}
|
||||
|
||||
|
||||
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.
Loading…
x
Reference in New Issue
Block a user