mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-08 16:24:54 +08:00
All chained settings now check for null tweens + Added HasProperty check to Material shortcuts that tween a specific property + Added Material.DOAlpha with specific-property parameter
This commit is contained in:
parent
c82c606db2
commit
42e1ef8180
@ -918,6 +918,14 @@
|
||||
Also stores the material 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>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
<param name="endValue">The end value to reach</param>
|
||||
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||
<param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFloat(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -918,6 +918,14 @@
|
||||
Also stores the material 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>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
<param name="endValue">The end value to reach</param>
|
||||
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||
<param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFloat(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -918,6 +918,14 @@
|
||||
Also stores the material 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>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
<param name="endValue">The end value to reach</param>
|
||||
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||
<param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFloat(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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) {
|
||||
|
||||
@ -21,7 +21,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.480";
|
||||
public static readonly string Version = "1.0.490";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -166,6 +166,10 @@ namespace DG.Tweening
|
||||
/// <param name="duration">The duration of the tween</param>
|
||||
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);
|
||||
}
|
||||
/// <summary>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</summary>
|
||||
/// <param name="endValue">The end value to reach</param>
|
||||
/// <param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||
/// <param name="duration">The duration of the tween</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>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</summary>
|
||||
@ -186,6 +204,10 @@ namespace DG.Tweening
|
||||
/// <param name="duration">The duration of the tween</param>
|
||||
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
|
||||
/// <param name="duration">The duration of the tween</param>
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace DG.Tweening
|
||||
/// Has no effect if the tween has already started</summary>
|
||||
public static T SetAutoKill<T>(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
|
||||
/// <param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
||||
public static T SetAutoKill<T>(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
|
||||
/// <param name="id">The ID to assign to this tween. Can be an int, a string, an object or anything else.</param>
|
||||
public static T SetId<T>(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
|
||||
/// <param name="target">The target to assign to this tween. Can be an int, a string, an object or anything else.</param>
|
||||
public static T SetTarget<T>(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
|
||||
/// <param name="loops">Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)</param>
|
||||
public static T SetLoops<T>(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
|
||||
/// <param name="loopType">Loop behaviour type (default: LoopType.Restart)</param>
|
||||
public static T SetLoops<T>(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
|
||||
/// <para>If applied to Sequences eases the whole sequence animation</para></summary>
|
||||
public static T SetEase<T>(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
|
||||
/// <param name="overshoot">Eventual overshoot to use with Back ease (default is 1.70158)</param>
|
||||
public static T SetEase<T>(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
|
||||
/// <param name="period">Eventual period to use with Elastic easeType (default is 0)</param>
|
||||
public static T SetEase<T>(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
|
||||
/// <para>If applied to Sequences eases the whole sequence animation</para></summary>
|
||||
public static T SetEase<T>(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
|
||||
/// <para>If applied to Sequences eases the whole sequence animation</para></summary>
|
||||
public static T SetEase<T>(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
|
||||
/// <summary>Allows the tween to be recycled after being killed.</summary>
|
||||
public static T SetRecyclable<T>(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
|
||||
/// <param name="recyclable">If TRUE the tween will be recycled after being killed, otherwise it will be destroyed.</param>
|
||||
public static T SetRecyclable<T>(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
|
||||
/// <param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
public static T SetUpdate<T>(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
|
||||
/// <param name="isIndependentUpdate">If TRUE the tween will ignore Unity's Time.timeScale</param>
|
||||
public static T SetUpdate<T>(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</summary>
|
||||
public static T OnStart<T>(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</summary>
|
||||
public static T OnPlay<T>(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.</summary>
|
||||
public static T OnPause<T>(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</summary>
|
||||
public static T OnRewind<T>(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</summary>
|
||||
public static T OnUpdate<T>(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</summary>
|
||||
public static T OnStepComplete<T>(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</summary>
|
||||
public static T OnComplete<T>(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</summary>
|
||||
public static T OnKill<T>(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</summary>
|
||||
public static T OnWaypointChange<T>(this T t, TweenCallback<int> 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
|
||||
/// <param name="asTween">Tween from which to copy the parameters</param>
|
||||
public static T SetAs<T>(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
|
||||
/// <param name="tweenParams">TweenParams from which to copy the parameters</param>
|
||||
public static T SetAs<T>(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
|
||||
/// <param name="t">The tween to append</param>
|
||||
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
|
||||
/// <param name="t">The tween to prepend</param>
|
||||
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</summary>
|
||||
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
|
||||
/// <param name="t">The tween to insert</param>
|
||||
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
|
||||
/// <param name="interval">The interval duration</param>
|
||||
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
|
||||
/// <param name="interval">The interval duration</param>
|
||||
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
|
||||
/// <param name="callback">The callback to append</param>
|
||||
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
|
||||
/// <param name="callback">The callback to prepend</param>
|
||||
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
|
||||
/// <param name="callback">The callback to insert</param>
|
||||
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.</summary>
|
||||
public static T From<T>(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
|
||||
/// <param name="isRelative">If TRUE the FROM value will be calculated as relative to the current one</param>
|
||||
public static T From<T>(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
|
||||
/// <para>Has no effect on Sequences or if the tween has already started</para></summary>
|
||||
public static T SetDelay<T>(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
|
||||
/// <para>Has no effect on Sequences or if the tween has already started</para></summary>
|
||||
public static T SetRelative<T>(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
|
||||
/// <para>Has no effect on Sequences or if the tween has already started</para></summary>
|
||||
public static T SetRelative<T>(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
|
||||
/// <para>Has no effect on Sequences, nested tweens, or if the tween has already started</para></summary>
|
||||
public static T SetSpeedBased<T>(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
|
||||
/// <para>Has no effect on Sequences, nested tweens, or if the tween has already started</para></summary>
|
||||
public static T SetSpeedBased<T>(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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<float, float, FloatOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector2, Vector2, VectorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector2, Vector2, VectorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector3, Vector3, VectorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector3, Vector3, VectorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector4, Vector4, VectorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector4, Vector4, VectorOptions> 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</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Quaternion, Vector3, QuaternionOptions> 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
|
||||
/// <param name="alphaOnly">If TRUE only the alpha value of the color will be tweened</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Color, Color, ColorOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Rect, Rect, RectOptions> 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</param>
|
||||
public static Tweener SetOptions(this TweenerCore<string, string, StringOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> 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
|
||||
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
|
||||
public static Tweener SetOptions(this TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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;
|
||||
|
||||
@ -918,6 +918,14 @@
|
||||
Also stores the material 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>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
<param name="endValue">The end value to reach</param>
|
||||
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
|
||||
<param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOFloat(UnityEngine.Material,System.Single,System.String,System.Single)">
|
||||
<summary>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</summary>
|
||||
|
||||
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