diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML index 21d6356..33da8e8 100644 --- a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.XML @@ -918,6 +918,14 @@ Also stores the material as the tween's target so it can be used for filtered operations The end value to reachThe duration of the tween + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + Tweens a Material's named float property to the given value. Also stores the material as the tween's target so it can be used for filtered operations diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll index 96f3676..ce5a671 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb index d8a9cc5..01e5611 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll index 77b5d5f..3ef22dd 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 5952ce1..b1103d2 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll index b19d7c9..dc950c4 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb index a30b56a..c84f623 100644 Binary files a/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityCompatibilityTests.Unity35/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML index 21d6356..33da8e8 100644 --- a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.XML @@ -918,6 +918,14 @@ Also stores the material as the tween's target so it can be used for filtered operations The end value to reachThe duration of the tween + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + Tweens a Material's named float property to the given value. Also stores the material as the tween's target so it can be used for filtered operations diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll index 96f3676..ce5a671 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb index d8a9cc5..01e5611 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll index 77b5d5f..3ef22dd 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 5952ce1..b1103d2 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll index b19d7c9..dc950c4 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb index a30b56a..c84f623 100644 Binary files a/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityTests.Unity4/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML index 21d6356..33da8e8 100644 --- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML @@ -918,6 +918,14 @@ Also stores the material as the tween's target so it can be used for filtered operations The end value to reachThe duration of the tween + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + Tweens a Material's named float property to the given value. Also stores the material as the tween's target so it can be used for filtered operations diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 96f3676..ce5a671 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb index d8a9cc5..01e5611 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll index 77b5d5f..3ef22dd 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb index 5952ce1..b1103d2 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll index b19d7c9..dc950c4 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb index a30b56a..c84f623 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb differ diff --git a/_DOTween.Assembly/DOTween/Core/Debugger.cs b/_DOTween.Assembly/DOTween/Core/Debugger.cs index 4f1e550..6421dfa 100644 --- a/_DOTween.Assembly/DOTween/Core/Debugger.cs +++ b/_DOTween.Assembly/DOTween/Core/Debugger.cs @@ -60,6 +60,11 @@ namespace DG.Tweening.Core LogWarning("This Tween is not a path tween"); } + public static void LogMissingMaterialProperty(string propertyName) + { + LogWarning(string.Format("This material doesn't have a {0} property", propertyName)); + } + public static void SetLogPriority(LogBehaviour logBehaviour) { switch (logBehaviour) { diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs index 99069f0..7ae6851 100644 --- a/_DOTween.Assembly/DOTween/DOTween.cs +++ b/_DOTween.Assembly/DOTween/DOTween.cs @@ -21,7 +21,7 @@ namespace DG.Tweening public class DOTween { /// DOTween's version - public static readonly string Version = "1.0.480"; + public static readonly string Version = "1.0.490"; /////////////////////////////////////////////// // Options //////////////////////////////////// diff --git a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs index 9078ff7..9006aa1 100644 --- a/_DOTween.Assembly/DOTween/ShortcutExtensions.cs +++ b/_DOTween.Assembly/DOTween/ShortcutExtensions.cs @@ -166,6 +166,10 @@ namespace DG.Tweening /// The duration of the tween public static Tweener DOColor(this Material target, Color endValue, string property, float duration) { + if (!target.HasProperty(property)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property); + return null; + } return DOTween.To(() => target.GetColor(property), x => target.SetColor(property, x), endValue, duration).SetTarget(target); } @@ -178,6 +182,20 @@ namespace DG.Tweening return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) .SetTarget(target); } + /// Tweens a Material's alpha color to the given value + /// (will have no effect unless your material supports transparency). + /// Also stores the material as the tween's target so it can be used for filtered operations + /// The end value to reach + /// The name of the material property to tween (like _Tint or _SpecColor) + /// The duration of the tween + public static Tweener DOFade(this Material target, float endValue, string property, float duration) + { + if (!target.HasProperty(property)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property); + return null; + } + return DOTween.ToAlpha(() => target.GetColor(property), x => target.SetColor(property, x), endValue, duration).SetTarget(target); + } /// Tweens a Material's named float property to the given value. /// Also stores the material as the tween's target so it can be used for filtered operations @@ -186,6 +204,10 @@ namespace DG.Tweening /// The duration of the tween public static Tweener DOFloat(this Material target, float endValue, string property, float duration) { + if (!target.HasProperty(property)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property); + return null; + } return DOTween.To(() => target.GetFloat(property), x => target.SetFloat(property, x), endValue, duration).SetTarget(target); } @@ -196,6 +218,10 @@ namespace DG.Tweening /// The duration of the tween public static Tweener DOVector(this Material target, Vector4 endValue, string property, float duration) { + if (!target.HasProperty(property)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property); + return null; + } return DOTween.To(() => target.GetVector(property), x => target.SetVector(property, x), endValue, duration).SetTarget(target); } diff --git a/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs b/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs index 3ac9845..bcd3fdf 100644 --- a/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs +++ b/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs @@ -25,7 +25,7 @@ namespace DG.Tweening /// Has no effect if the tween has already started public static T SetAutoKill(this T t) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; t.autoKill = true; return t; @@ -35,7 +35,7 @@ namespace DG.Tweening /// If TRUE the tween will be automatically killed when complete public static T SetAutoKill(this T t, bool autoKillOnCompletion) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; t.autoKill = autoKillOnCompletion; return t; @@ -45,7 +45,7 @@ namespace DG.Tweening /// The ID to assign to this tween. Can be an int, a string, an object or anything else. public static T SetId(this T t, object id) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.id = id; return t; @@ -58,7 +58,7 @@ namespace DG.Tweening /// The target to assign to this tween. Can be an int, a string, an object or anything else. public static T SetTarget(this T t, object target) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.target = target; return t; @@ -69,7 +69,7 @@ namespace DG.Tweening /// Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) public static T SetLoops(this T t, int loops) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; if (loops < -1) loops = -1; else if (loops == 0) loops = 1; @@ -87,7 +87,7 @@ namespace DG.Tweening /// Loop behaviour type (default: LoopType.Restart) public static T SetLoops(this T t, int loops, LoopType loopType) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; if (loops < -1) loops = -1; else if (loops == 0) loops = 1; @@ -105,7 +105,7 @@ namespace DG.Tweening /// If applied to Sequences eases the whole sequence animation public static T SetEase(this T t, Ease ease) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.easeType = ease; t.customEase = null; @@ -116,7 +116,7 @@ namespace DG.Tweening /// Eventual overshoot to use with Back ease (default is 1.70158) public static T SetEase(this T t, Ease ease, float overshoot) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.easeType = ease; t.easeOvershootOrAmplitude = overshoot; @@ -129,7 +129,7 @@ namespace DG.Tweening /// Eventual period to use with Elastic easeType (default is 0) public static T SetEase(this T t, Ease ease, float amplitude, float period) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.easeType = ease; t.easeOvershootOrAmplitude = amplitude; @@ -141,7 +141,7 @@ namespace DG.Tweening /// If applied to Sequences eases the whole sequence animation public static T SetEase(this T t, AnimationCurve animCurve) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.easeType = Ease.INTERNAL_Custom; t.customEase = new EaseCurve(animCurve).Evaluate; @@ -151,7 +151,7 @@ namespace DG.Tweening /// If applied to Sequences eases the whole sequence animation public static T SetEase(this T t, EaseFunction customEase) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.easeType = Ease.INTERNAL_Custom; t.customEase = customEase; @@ -161,7 +161,7 @@ namespace DG.Tweening /// Allows the tween to be recycled after being killed. public static T SetRecyclable(this T t) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.isRecyclable = true; return t; @@ -170,7 +170,7 @@ namespace DG.Tweening /// If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. public static T SetRecyclable(this T t, bool recyclable) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.isRecyclable = recyclable; return t; @@ -180,7 +180,7 @@ namespace DG.Tweening /// If TRUE the tween will ignore Unity's Time.timeScale public static T SetUpdate(this T t, bool isIndependentUpdate) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; TweenManager.SetUpdateType(t, DOTween.defaultUpdateType, isIndependentUpdate); return t; @@ -190,7 +190,7 @@ namespace DG.Tweening /// If TRUE the tween will ignore Unity's Time.timeScale public static T SetUpdate(this T t, UpdateType updateType, bool isIndependentUpdate = false) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; TweenManager.SetUpdateType(t, updateType, isIndependentUpdate); return t; @@ -200,7 +200,7 @@ namespace DG.Tweening /// Called the first time the tween is set in a playing state, after any eventual delay public static T OnStart(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onStart = action; return t; @@ -211,7 +211,7 @@ namespace DG.Tweening /// Also called each time the tween resumes playing from a paused state public static T OnPlay(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onPlay = action; return t; @@ -222,7 +222,7 @@ namespace DG.Tweening /// If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. public static T OnPause(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onPause = action; return t; @@ -234,7 +234,7 @@ namespace DG.Tweening /// Rewinding a tween that is already rewinded will not fire this callback public static T OnRewind(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onRewind = action; return t; @@ -244,7 +244,7 @@ namespace DG.Tweening /// Called each time the tween updates public static T OnUpdate(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onUpdate = action; return t; @@ -254,7 +254,7 @@ namespace DG.Tweening /// Called the moment the tween completes one loop cycle, even when going backwards public static T OnStepComplete(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onStepComplete = action; return t; @@ -264,7 +264,7 @@ namespace DG.Tweening /// Called the moment the tween reaches its final forward position, loops included public static T OnComplete(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onComplete = action; return t; @@ -274,7 +274,7 @@ namespace DG.Tweening /// Called the moment the tween is killed public static T OnKill(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onKill = action; return t; @@ -284,7 +284,7 @@ namespace DG.Tweening /// Called when a path tween's current waypoint changes public static T OnWaypointChange(this T t, TweenCallback action) where T : Tween { - if (!t.active) return t; + if (t == null || !t.active) return t; t.onWaypointChange = action; return t; @@ -297,7 +297,7 @@ namespace DG.Tweening /// Tween from which to copy the parameters public static T SetAs(this T t, Tween asTween) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; // t.isFrom = asTween.isFrom; // t.target = asTween.target; @@ -341,7 +341,7 @@ namespace DG.Tweening /// TweenParams from which to copy the parameters public static T SetAs(this T t, TweenParams tweenParams) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; TweenManager.SetUpdateType(t, tweenParams.updateType, tweenParams.isIndependentUpdate); t.id = tweenParams.id; @@ -388,7 +388,7 @@ namespace DG.Tweening /// The tween to append public static Sequence Append(this Sequence s, Tween t) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (t == null || !t.active) return s; Sequence.DoInsert(s, t, s.duration); @@ -399,7 +399,7 @@ namespace DG.Tweening /// The tween to prepend public static Sequence Prepend(this Sequence s, Tween t) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (t == null || !t.active) return s; Sequence.DoPrepend(s, t); @@ -409,7 +409,7 @@ namespace DG.Tweening /// Has no effect if the Sequence has already started public static Sequence Join(this Sequence s, Tween t) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (t == null || !t.active) return s; Sequence.DoInsert(s, t, s.lastTweenInsertTime); @@ -422,7 +422,7 @@ namespace DG.Tweening /// The tween to insert public static Sequence Insert(this Sequence s, float atPosition, Tween t) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (t == null || !t.active) return s; Sequence.DoInsert(s, t, atPosition); @@ -434,7 +434,7 @@ namespace DG.Tweening /// The interval duration public static Sequence AppendInterval(this Sequence s, float interval) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; Sequence.DoAppendInterval(s, interval); return s; @@ -444,7 +444,7 @@ namespace DG.Tweening /// The interval duration public static Sequence PrependInterval(this Sequence s, float interval) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; Sequence.DoPrependInterval(s, interval); return s; @@ -455,7 +455,7 @@ namespace DG.Tweening /// The callback to append public static Sequence AppendCallback(this Sequence s, TweenCallback callback) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (callback == null) return s; Sequence.DoInsertCallback(s, callback, s.duration); @@ -466,7 +466,7 @@ namespace DG.Tweening /// The callback to prepend public static Sequence PrependCallback(this Sequence s, TweenCallback callback) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (callback == null) return s; Sequence.DoInsertCallback(s, callback, 0); @@ -479,7 +479,7 @@ namespace DG.Tweening /// The callback to insert public static Sequence InsertCallback(this Sequence s, float atPosition, TweenCallback callback) { - if (!s.active || s.creationLocked) return s; + if (s == null || !s.active || s.creationLocked) return s; if (callback == null) return s; Sequence.DoInsertCallback(s, callback, atPosition); @@ -493,7 +493,7 @@ namespace DG.Tweening /// then immediately sends the target to the previously set endValue. public static T From(this T t) where T : Tweener { - if (!t.active || t.creationLocked || !t.isFromAllowed) return t; + if (t == null || !t.active || t.creationLocked || !t.isFromAllowed) return t; t.isFrom = true; t.SetFrom(false); @@ -504,7 +504,7 @@ namespace DG.Tweening /// If TRUE the FROM value will be calculated as relative to the current one public static T From(this T t, bool isRelative) where T : Tweener { - if (!t.active || t.creationLocked || !t.isFromAllowed) return t; + if (t == null || !t.active || t.creationLocked || !t.isFromAllowed) return t; t.isFrom = true; if (!isRelative) t.SetFrom(false); @@ -516,7 +516,7 @@ namespace DG.Tweening /// Has no effect on Sequences or if the tween has already started public static T SetDelay(this T t, float delay) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; t.delay = delay; t.delayComplete = delay <= 0; @@ -528,7 +528,7 @@ namespace DG.Tweening /// Has no effect on Sequences or if the tween has already started public static T SetRelative(this T t) where T : Tween { - if (!t.active || t.creationLocked || t.isFrom || t.isBlendable) return t; + if (t == null || !t.active || t.creationLocked || t.isFrom || t.isBlendable) return t; t.isRelative = true; return t; @@ -538,7 +538,7 @@ namespace DG.Tweening /// Has no effect on Sequences or if the tween has already started public static T SetRelative(this T t, bool isRelative) where T : Tween { - if (!t.active || t.creationLocked || t.isFrom || t.isBlendable) return t; + if (t == null || !t.active || t.creationLocked || t.isFrom || t.isBlendable) return t; t.isRelative = isRelative; return t; @@ -549,7 +549,7 @@ namespace DG.Tweening /// Has no effect on Sequences, nested tweens, or if the tween has already started public static T SetSpeedBased(this T t) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; t.isSpeedBased = true; return t; @@ -559,7 +559,7 @@ namespace DG.Tweening /// Has no effect on Sequences, nested tweens, or if the tween has already started public static T SetSpeedBased(this T t, bool isSpeedBased) where T : Tween { - if (!t.active || t.creationLocked) return t; + if (t == null || !t.active || t.creationLocked) return t; t.isSpeedBased = isSpeedBased; return t; @@ -573,7 +573,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -583,7 +583,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -593,7 +593,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, AxisConstraint axisConstraint, bool snapping = false) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.axisConstraint = axisConstraint; t.plugOptions.snapping = snapping; @@ -604,7 +604,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -614,7 +614,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, AxisConstraint axisConstraint, bool snapping = false) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.axisConstraint = axisConstraint; t.plugOptions.snapping = snapping; @@ -625,7 +625,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -635,7 +635,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, AxisConstraint axisConstraint, bool snapping = false) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.axisConstraint = axisConstraint; t.plugOptions.snapping = snapping; @@ -647,7 +647,7 @@ namespace DG.Tweening /// If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative public static Tweener SetOptions(this TweenerCore t, bool useShortest360Route = true) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.rotateMode = useShortest360Route ? RotateMode.Fast : RotateMode.FastBeyond360; return t; @@ -657,7 +657,7 @@ namespace DG.Tweening /// If TRUE only the alpha value of the color will be tweened public static Tweener SetOptions(this TweenerCore t, bool alphaOnly) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.alphaOnly = alphaOnly; return t; @@ -667,7 +667,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -682,7 +682,7 @@ namespace DG.Tweening /// Leave it to NULL to use default ones public static Tweener SetOptions(this TweenerCore t, bool richTextEnabled, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.richTextEnabled = richTextEnabled; t.plugOptions.scrambleMode = scrambleMode; @@ -698,7 +698,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, bool snapping) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.snapping = snapping; return t; @@ -707,7 +707,7 @@ namespace DG.Tweening /// If TRUE the tween will smoothly snap all values to integers public static Tweener SetOptions(this TweenerCore t, AxisConstraint axisConstraint, bool snapping = false) { - if (!t.active) return t; + if (t == null || !t.active) return t; t.plugOptions.axisConstraint = axisConstraint; t.plugOptions.snapping = snapping; @@ -739,6 +739,8 @@ namespace DG.Tweening bool closePath, AxisConstraint lockPosition = AxisConstraint.None, AxisConstraint lockRotation = AxisConstraint.None ) { + if (t == null || !t.active) return t; + t.plugOptions.isClosedPath = closePath; t.plugOptions.lockPositionAxis = lockPosition; t.plugOptions.lockRotationAxis = lockRotation; @@ -756,6 +758,8 @@ namespace DG.Tweening this TweenerCore t, Vector3 lookAtPosition, Vector3? forwardDirection = null, Vector3? up = null ) { + if (t == null || !t.active) return t; + t.plugOptions.orientType = OrientType.LookAtPosition; t.plugOptions.lookAtPosition = lookAtPosition; SetPathForwardDirection(t, forwardDirection, up); @@ -772,6 +776,8 @@ namespace DG.Tweening this TweenerCore t, Transform lookAtTransform, Vector3? forwardDirection = null, Vector3? up = null ) { + if (t == null || !t.active) return t; + t.plugOptions.orientType = OrientType.LookAtTransform; t.plugOptions.lookAtTransform = lookAtTransform; SetPathForwardDirection(t, forwardDirection, up); @@ -788,6 +794,8 @@ namespace DG.Tweening this TweenerCore t, float lookAhead, Vector3? forwardDirection = null, Vector3? up = null ) { + if (t == null || !t.active) return t; + t.plugOptions.orientType = OrientType.ToPath; if (lookAhead < PathPlugin.MinLookAhead) lookAhead = PathPlugin.MinLookAhead; t.plugOptions.lookAhead = lookAhead; @@ -797,6 +805,8 @@ namespace DG.Tweening static void SetPathForwardDirection(this TweenerCore t, Vector3? forwardDirection = null, Vector3? up = null) { + if (t == null || !t.active) return; + t.plugOptions.hasCustomForwardDirection = forwardDirection != null && forwardDirection != Vector3.zero || up != null && up != Vector3.zero; if (t.plugOptions.hasCustomForwardDirection) { if (forwardDirection == Vector3.zero) forwardDirection = Vector3.forward; diff --git a/_DOTween.Assembly/bin/DOTween.XML b/_DOTween.Assembly/bin/DOTween.XML index 21d6356..33da8e8 100644 --- a/_DOTween.Assembly/bin/DOTween.XML +++ b/_DOTween.Assembly/bin/DOTween.XML @@ -918,6 +918,14 @@ Also stores the material as the tween's target so it can be used for filtered operations The end value to reachThe duration of the tween + + Tweens a Material's alpha color to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The name of the material property to tween (like _Tint or _SpecColor) + The duration of the tween + Tweens a Material's named float property to the given value. Also stores the material as the tween's target so it can be used for filtered operations diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 96f3676..ce5a671 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll and b/_DOTween.Assembly/bin/DOTween.dll differ diff --git a/_DOTween.Assembly/bin/DOTween.dll.mdb b/_DOTween.Assembly/bin/DOTween.dll.mdb index d8a9cc5..01e5611 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ diff --git a/_DOTween.Assembly/bin/DOTween43.dll b/_DOTween.Assembly/bin/DOTween43.dll index 77b5d5f..3ef22dd 100644 Binary files a/_DOTween.Assembly/bin/DOTween43.dll and b/_DOTween.Assembly/bin/DOTween43.dll differ diff --git a/_DOTween.Assembly/bin/DOTween43.dll.mdb b/_DOTween.Assembly/bin/DOTween43.dll.mdb index 5952ce1..b1103d2 100644 Binary files a/_DOTween.Assembly/bin/DOTween43.dll.mdb and b/_DOTween.Assembly/bin/DOTween43.dll.mdb differ diff --git a/_DOTween.Assembly/bin/DOTween46.dll b/_DOTween.Assembly/bin/DOTween46.dll index b19d7c9..dc950c4 100644 Binary files a/_DOTween.Assembly/bin/DOTween46.dll and b/_DOTween.Assembly/bin/DOTween46.dll differ diff --git a/_DOTween.Assembly/bin/DOTween46.dll.mdb b/_DOTween.Assembly/bin/DOTween46.dll.mdb index a30b56a..c84f623 100644 Binary files a/_DOTween.Assembly/bin/DOTween46.dll.mdb and b/_DOTween.Assembly/bin/DOTween46.dll.mdb differ