mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-04 14:24:55 +08:00
Implemented WP8.1 fix with new DOBlendableColor shortcuts
This commit is contained in:
parent
0cda757c93
commit
a5b9515df9
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.
@ -27,7 +27,6 @@ public class BlendableTweens : BrainBase
|
||||
|
||||
Vector3 to;
|
||||
Color toCol;
|
||||
float toFloat;
|
||||
float duration;
|
||||
int loops;
|
||||
|
||||
@ -100,31 +99,6 @@ public class BlendableTweens : BrainBase
|
||||
if (fromBlendable) sprites[0].DOBlendableColor(toCol, duration).From().SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
else sprites[0].DOBlendableColor(toCol, duration).SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
}
|
||||
|
||||
// Fade
|
||||
duration = 3;
|
||||
toFloat = -1;
|
||||
if (from) renderers[1].material.DOBlendableFadeBy(toFloat, duration).From().SetEase(ease).SetAutoKill(false).Pause();
|
||||
else renderers[1].material.DOBlendableFadeBy(toFloat, duration).SetEase(ease).SetAutoKill(false).Pause();
|
||||
if (addBlendable) {
|
||||
toFloat = 1;
|
||||
duration = repeatBlendable ? 1 : 3;
|
||||
loops = repeatBlendable ? 3 : 1;
|
||||
if (fromBlendable) renderers[1].material.DOBlendableFadeBy(toFloat, duration).From().SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
else renderers[1].material.DOBlendableFadeBy(toFloat, duration).SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
}
|
||||
|
||||
duration = 3;
|
||||
toFloat = -1;
|
||||
if (from) sprites[1].DOBlendableFadeBy(toFloat, duration).From().SetEase(ease).SetAutoKill(false).Pause();
|
||||
else sprites[1].DOBlendableFadeBy(toFloat, duration).SetEase(ease).SetAutoKill(false).Pause();
|
||||
if (addBlendable) {
|
||||
toFloat = 1;
|
||||
duration = repeatBlendable ? 1 : 3;
|
||||
loops = repeatBlendable ? 3 : 1;
|
||||
if (fromBlendable) sprites[1].DOBlendableFadeBy(toFloat, duration).From().SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
else sprites[1].DOBlendableFadeBy(toFloat, duration).SetEase(ease).SetLoops(loops, LoopType.Yoyo).SetAutoKill(false).Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable 1591
|
||||
namespace DG.Tweening.Core.Easing
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@ -24,7 +24,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.531";
|
||||
public static readonly string Version = "1.0.535";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -717,7 +717,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this Light target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
@ -738,7 +742,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this Material target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
@ -761,7 +769,11 @@ namespace DG.Tweening
|
||||
}
|
||||
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
// License Copyright (c) Daniele Giardini.
|
||||
// This work is subject to the terms at http://dotween.demigiant.com/license.php
|
||||
|
||||
#if WP81
|
||||
using DG.Tweening.Core.Surrogates;
|
||||
#endif
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Core.Enums;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
@ -105,7 +108,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'WP81|AnyCPU'">
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;WP81</DefineConstants>
|
||||
<DocumentationFile>..\bin\DOTween46.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>1573</NoWarn>
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
// License Copyright (c) Daniele Giardini.
|
||||
// This work is subject to the terms at http://dotween.demigiant.com/license.php
|
||||
|
||||
#if WP81
|
||||
using DG.Tweening.Core.Surrogates;
|
||||
#endif
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
using UnityEngine;
|
||||
@ -257,7 +260,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
@ -278,7 +285,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
@ -299,7 +310,11 @@ namespace DG.Tweening
|
||||
public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
|
||||
{
|
||||
endValue = endValue - target.color;
|
||||
#if WP81
|
||||
ColorSurrogate to = new ColorSurrogate(0, 0, 0, 0);
|
||||
#else
|
||||
Color to = new Color(0, 0, 0, 0);
|
||||
#endif
|
||||
return DOTween.To(() => to, x => {
|
||||
Color diff = x - to;
|
||||
to = x;
|
||||
|
||||
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