1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-11 17:48:47 +08:00

Added DOPivot/X/Y shortcut

This commit is contained in:
Demigiant 2016-05-03 10:40:50 +02:00
parent 652fb67e86
commit d151ff5679
46 changed files with 87 additions and 5 deletions

View File

@ -126,6 +126,21 @@
<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>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>Tweens a RectTransform's pivot to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot X to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot Y to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>Tweens a RectTransform's sizeDelta to the given value.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -126,6 +126,21 @@
<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>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>Tweens a RectTransform's pivot to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot X to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot Y to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>Tweens a RectTransform's sizeDelta to the given value.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -126,6 +126,21 @@
<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>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>Tweens a RectTransform's pivot to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot X to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot Y to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>Tweens a RectTransform's sizeDelta to the given value.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -10,15 +10,12 @@ using UnityEngine.UI;
public class TempTests : BrainBase
{
public Transform target;
public RectTransform target;
IEnumerator Start ()
{
yield return new WaitForSeconds(0.5f);
DOTween.Sequence()
.Append(target.DOMoveX(1, 1))
.Append(target.DOMoveY(1, 1))
.SetLoops(-1, LoopType.Incremental);
target.DOPivot(Vector2.zero, 2);
}
}

View File

@ -259,6 +259,31 @@ namespace DG.Tweening
.SetOptions(snapping).SetTarget(target);
}
/// <summary>Tweens a RectTransform's pivot to the given value.
/// Also stores the RectTransform 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>
public static Tweener DOPivot(this RectTransform target, Vector2 endValue, float duration)
{
return DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration)
.SetTarget(target);
}
/// <summary>Tweens a RectTransform's pivot X to the given value.
/// Also stores the RectTransform 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>
public static Tweener DOPivotX(this RectTransform target, float endValue, float duration)
{
return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration)
.SetOptions(AxisConstraint.X).SetTarget(target);
}
/// <summary>Tweens a RectTransform's pivot Y to the given value.
/// Also stores the RectTransform 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>
public static Tweener DOPivotY(this RectTransform target, float endValue, float duration)
{
return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration)
.SetOptions(AxisConstraint.Y).SetTarget(target);
}
/// <summary>Tweens a RectTransform's sizeDelta to the given value.
/// Also stores the RectTransform 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>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -126,6 +126,21 @@
<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>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>Tweens a RectTransform's pivot to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot X to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>Tweens a RectTransform's pivot Y to the given value.
Also stores the RectTransform 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.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>Tweens a RectTransform's sizeDelta to the given value.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

Binary file not shown.