Skip to content

Commit

Permalink
Hyper-compatible version fix which allows Color32 to work correctly
Browse files Browse the repository at this point in the history
+ Fix to ScrollRect.DONormalizedPos not working correctly with hyper-compatible mode
  • Loading branch information
Demigiant committed Mar 12, 2016
1 parent 9fb0daa commit f3a5494
Show file tree
Hide file tree
Showing 46 changed files with 56 additions and 55 deletions.
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 modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll
Binary file not shown.
Binary file modified UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween50.dll.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll
Binary file not shown.
Binary file modified UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void Start()
// In this case, when the target is reached the tween will be
// automatically killed and the following will stop
Vector3 prevTargetPos = targetToFollow.position;
Tweener followTween = follower.DOMove(targetToFollow.position, 2);
Tweener followTween = follower.DOMove(targetToFollow.position, 4);
followTween.OnUpdate(()=> {
if (prevTargetPos != targetToFollow.position) {
prevTargetPos = targetToFollow.position;
Expand Down
26 changes: 3 additions & 23 deletions UnityTests.Unity5/Assets/_Tests/TempTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,11 @@

public class TempTests : BrainBase
{
public Transform target;
public float InitialDelay = 1;
public float ExpandDelay = 2;
public float ExpandSpeed = 0.1f;
public float RetractDelay = 2;
public float RetractSpeed = 2;
public Color32 color;

float time;

Sequence s;
// Use this for initialization
void Start ()
{
time = Time.realtimeSinceStartup;

s = DOTween.Sequence();
s.Append(target.DOMove(target.position + new Vector3(0, 0.1f, 0),0.1f).SetDelay(InitialDelay));
s.Append(target.DOMove(target.position + new Vector3(0, 1, 0), ExpandSpeed).SetDelay(ExpandDelay));
s.Append(target.DOMove(target.position - new Vector3(0, 1.1f, 0), RetractSpeed).SetDelay(RetractDelay));
s.SetLoops(-1, LoopType.Restart).OnStepComplete(Step);
}

void Step()
{
Debug.Log(Time.realtimeSinceStartup - time);
time = Time.realtimeSinceStartup;
DOTween.To(()=> color, x=> color = x, Color.red, 2)
.OnUpdate(()=> Debug.Log(color));
}
}
Binary file modified UnityTests.Unity5/Assets/_Tests/TempTests.unity
Binary file not shown.
10 changes: 10 additions & 0 deletions _DOTween.Assembly/DOTween/Core/Surrogates/ColorWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ public static implicit operator Color(ColorWrapper v)
return v.value;
}

public static implicit operator Color32(ColorWrapper v)
{
return v.value;
}

public static implicit operator ColorWrapper(Color v)
{
return new ColorWrapper(v);
}

public static implicit operator ColorWrapper(Color32 v)
{
return new ColorWrapper(v);
}
}
}
#endif
2 changes: 1 addition & 1 deletion _DOTween.Assembly/DOTween/DOTween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// <summary>DOTween's version</summary>
public static readonly string Version = "1.1.180";
public static readonly string Version = "1.1.190";

///////////////////////////////////////////////
// Options ////////////////////////////////////
Expand Down
71 changes: 41 additions & 30 deletions _DOTween.Assembly/DOTween46/ShortcutExtensions46.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
using DG.Tweening.Core.Enums;
using UnityEngine;
using UnityEngine.UI;
#if COMPATIBLE
using DG.Tweening.Core.Surrogates;
#endif

namespace DG.Tweening
{
Expand All @@ -17,9 +20,9 @@ namespace DG.Tweening
/// </summary>
public static class ShortcutExtensions46
{
#region Unity UI
#region Unity UI

#region CanvasGroup
#region CanvasGroup

/// <summary>Tweens a CanvasGroup's alpha color to the given value.
/// Also stores the canvasGroup as the tween's target so it can be used for filtered operations</summary>
Expand All @@ -30,9 +33,9 @@ public static Tweener DOFade(this CanvasGroup target, float endValue, float dura
.SetTarget(target);
}

#endregion
#endregion

#region Graphic
#region Graphic

/// <summary>Tweens an Graphic's color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
Expand All @@ -51,9 +54,9 @@ public static Tweener DOFade(this Graphic target, float endValue, float duration
.SetTarget(target);
}

#endregion
#endregion

#region Image
#region Image

/// <summary>Tweens an Image's color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
Expand Down Expand Up @@ -106,9 +109,9 @@ public static Sequence DOGradientColor(this Image target, Gradient gradient, flo
return s;
}

#endregion
#endregion

#region LayoutElement
#region LayoutElement

/// <summary>Tweens an LayoutElement's flexibleWidth/Height to the given value.
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
Expand Down Expand Up @@ -164,9 +167,9 @@ public static Tweener DOPreferredSize(this LayoutElement target, Vector2 endValu
.SetOptions(snapping).SetTarget(target);
}

#endregion
#endregion

#region Outline
#region Outline

/// <summary>Tweens a Outline's effectColor to the given value.
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
Expand Down Expand Up @@ -194,9 +197,9 @@ public static Tweener DOScale(this Outline target, Vector2 endValue, float durat
.SetTarget(target);
}

#endregion
#endregion

#region RectTransform
#region RectTransform

/// <summary>Tweens a RectTransform's anchoredPosition to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
Expand Down Expand Up @@ -309,7 +312,7 @@ public static Tweener DOShakeAnchorPos(this RectTransform target, float duration
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
}

#region Special
#region Special

/// <summary>Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
/// Returns a Sequence instead of a Tweener.
Expand Down Expand Up @@ -344,23 +347,31 @@ public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endVal
return s;
}

#endregion
#endregion

#endregion
#endregion

#region ScrollRect
#region ScrollRect

/// <summary>Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
{
#if COMPATIBLE
return DOTween.To(() => new Vector2Wrapper(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
x => {
target.horizontalNormalizedPosition = x.value.x;
target.verticalNormalizedPosition = x.value.y;
}, endValue, duration)
#else
return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
x => {
target.horizontalNormalizedPosition = x.x;
target.verticalNormalizedPosition = x.y;
}, endValue, duration)
#endif
.SetOptions(snapping).SetTarget(target);
}
/// <summary>Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
Expand All @@ -382,9 +393,9 @@ public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endV
.SetOptions(snapping).SetTarget(target);
}

#endregion
#endregion

#region Slider
#region Slider

/// <summary>Tweens a Slider's value to the given value.
/// Also stores the Slider as the tween's target so it can be used for filtered operations</summary>
Expand All @@ -396,9 +407,9 @@ public static Tweener DOValue(this Slider target, float endValue, float duration
.SetOptions(snapping).SetTarget(target);
}

#endregion
#endregion

#region Text
#region Text

/// <summary>Tweens a Text's color to the given value.
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
Expand Down Expand Up @@ -433,13 +444,13 @@ public static Tweener DOText(this Text target, string endValue, float duration,
.SetTarget(target);
}

#endregion
#endregion

#endregion
#endregion

#region Blendables
#region Blendables

#region Graphic
#region Graphic

/// <summary>Tweens a Graphic's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
Expand All @@ -462,9 +473,9 @@ public static Tweener DOBlendableColor(this Graphic target, Color endValue, floa
.Blendable().SetTarget(target);
}

#endregion
#endregion

#region Image
#region Image

/// <summary>Tweens a Image's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
Expand All @@ -487,9 +498,9 @@ public static Tweener DOBlendableColor(this Image target, Color endValue, float
.Blendable().SetTarget(target);
}

#endregion
#endregion

#region Text
#region Text

/// <summary>Tweens a Text's color BY the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
Expand All @@ -512,8 +523,8 @@ public static Tweener DOBlendableColor(this Text target, Color endValue, float d
.Blendable().SetTarget(target);
}

#endregion
#endregion

#endregion
#endregion
}
}
Binary file modified _DOTween.Assembly/bin/DOTween.dll
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween.dll.mdb
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween43.dll
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween43.dll.mdb
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween46.dll
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween46.dll.mdb
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween50.dll
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/DOTween50.dll.mdb
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/Editor/DOTweenEditor.dll
Binary file not shown.
Binary file modified _DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb
Binary file not shown.

0 comments on commit f3a5494

Please sign in to comment.