1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-21 01:36:05 +08:00

Added RectTransform.DOPunchAnchorPos

This commit is contained in:
Daniele Giardini 2015-05-09 14:37:02 +02:00
parent f9f8b96b01
commit 4daa432005
32 changed files with 65 additions and 1 deletions

View File

@ -91,6 +91,18 @@
<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.ShortcutExtensions.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
as if it was connected to the starting position via an elastic.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
1 creates a full oscillation between the punch direction and the opposite direction,
while 0 oscillates only between the punch and the start position</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -91,6 +91,18 @@
<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.ShortcutExtensions.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
as if it was connected to the starting position via an elastic.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
1 creates a full oscillation between the punch direction and the opposite direction,
while 0 oscillates only between the punch and the start position</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -91,6 +91,18 @@
<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.ShortcutExtensions.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
as if it was connected to the starting position via an elastic.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
1 creates a full oscillation between the punch direction and the opposite direction,
while 0 oscillates only between the punch and the start position</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// <summary>DOTween's version</summary>
public static readonly string Version = "1.0.695";
public static readonly string Version = "1.0.700";
///////////////////////////////////////////////
// Options ////////////////////////////////////

View File

@ -205,6 +205,22 @@ namespace DG.Tweening
.SetOptions(snapping).SetTarget(target);
}
/// <summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
/// as if it was connected to the starting position via an elastic.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="vibrato">Indicates how much will the punch vibrate</param>
/// <param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
/// 1 creates a full oscillation between the punch direction and the opposite direction,
/// while 0 oscillates only between the punch and the start position</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
{
return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
.SetTarget(target).SetOptions(snapping);
}
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="duration">The duration of the tween</param>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -91,6 +91,18 @@
<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.ShortcutExtensions.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
as if it was connected to the starting position via an elastic.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
1 creates a full oscillation between the punch direction and the opposite direction,
while 0 oscillates only between the punch and the start position</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>